User Controls :: Disable Or Enable Menu Items Based On Login Type Of Logged In User
Jun 6, 2013
I have table called ROLE with fields (id,name,permission) example values (1001,madhu,hr)
I have another table called LOGIN with fields(id,DOB,password) example values(1001,24101989,madhukumar)
What i want is , if i login using the LOGIN table ,it check the id and permission in the ROLE table , if the permission is 'hr' it enable to access the menu , or if the permission is any other it just print the error message ("no permission")
Note: menu is placed in master page , but login is not in the master page ...
I want to enable/disable controls of a asp.net page against a logged in user's permission. say 'admin' & 'hr' can change user's birth date text-box in a page but others will see the text-box as disabled.
I need a help in creating a vertical oriented Menu control with dynamic url's set in there Navigate Url property.Also i need to set the menu items as enable/disable in two different modes say edit/new.
i need to change menu bar links according to the users,how to made this possible using menubar control and sitemap path,as i dont have constant users...i dont know who is the top user and who is the low level user?
I'm trying to allow logged user who are in department XYZ to perform some task for my third party App. I have two SQL tables named Users & UserList. The third party app (GoldMine) graps the USERNAME from the Users table and store it as UserID which I then referecnce SessionID. The UserList table has two columns (GM_UserName & Department) which I'm interested in. When a user login into the 3rd party app (GoldMine), i then compare the USERNAME (from Users table) to GM_UserName (from UserList table) and see whether GM_UserName is in = 'Dept XYZ'. Take a look at the SQL query below.
sqlDept = "SELECT USERNAME FROM Users LEFT JOIN UserList ON UserList.GM_UserName=Users.UserName WHERE UserList.Department ='Dept XYZ'"
I'm able to do this.
If Session("Userid") = "TestUser1" Or Session("UserID") = "TestUser2" Then Do this Else Do that End If BUT unable to do this... If user's Department = 'Department XYZ' Then Do This Else Do that End IF
I have a user control in my Master page and need to be able to Enable/Disable it from ANY page. How is this done? My user control has a few TextBox fields and a button. I was hoping to set a public property and simply Enable/Disable, but public properties seem to only work on the Master page code behind and not other pages.
I am looking to enable/disable controls (TextBox, DropDownList, etc.) in a GridViews template column based on the users specific access level when the user clicks the edit button. I have tried the following two methods:
I want to display a menu (which will be strongly typed with it's own unique model) across all pages only if a user is logged in.What menu items are available depend on the user's role and also I'll need to hit the repository to get numbers like "x Messages", etc
Been scratching my head for a simple solution here. Don't want to create something that need changes all over the place.All my controllers derive from a BaseController, all my Models from BaseViewModel....probably where I'll be implementing functionality for this.
iam using masterpage and sitemap in my project, what i want to is that if user login is did, based on the user previlage in need to show the sitemap menu page if user i have the previlage to see the page then i should enable that page otherwise i need disable that page
I want to know how can i redirect a user to a different page when he tries to access a page restricted to another role?
The scenario is as follows:
I have a folder "Gestao" that only allows users in role "Administrator"
If an anonymous user tries to access that folder he is redirected to the login page, but if a logged in user whose role is "friend" tries to access this folder he is also redirected to the login page. I want to redirect him to a page showing a message that he has no permission to access that page/area.
How can I do that? Should i have code on the Page_load event of the login page checking the user role and then redirect him to the correct page? Or is there some otherway to do this?
We have an application where the controls are dynamically added to the form based on the logged in user,
This user controls related data is stored in the database. There is lot of logic in the code behind in the asp.net webforms which is so messy to maintain it, we are planning to re-write it using the MVC framework.
I would say there would be rougly 50 different forms based on the user logged in, is it good idea to create so many views and redirect to the appropriate view based on the logged in user, in some of the forms there might be minor difference like the order of the Control might change.
I have a requirement to be able to stream MP3s based on the user who is logged in. Eg, user 1 should only be able to listen to 1.mp3, user 2 should only be able to listen to 2.mp3 etc. All the mp3s would be stored in a particular directory on the server.
I am currently investigating the Silverlight audio player available at [URL]. However, I am unable to find a way to programmatically specify the file to stream once the user clicks the play button.
Are there any other media players/controls that allow streaming and also allow specifying the audio file to play programmatically?
We are developing for a customer a series of .NET intranet applications currentlydeveloped in ASP. However we would like to avoid the users the annoyance of having of login twice when they pass from one .NET application to an ASP one, Is there any way to export the session data from one application to the other?
I have login page, users enter their username and password ... I want when users enter their password wrong after 3 time they can't enter password until 24 hours after that they can try it again, How i can do it?
I have a page that loads a two different files that the user uploaded during page_load. The code is an example I used from the aspsnippets site. The files are stored in a server folder while the location is saved in the database. The code below gets all files in the folder and binds them to a gridview.
Dim filePaths() As String = Directory.GetFiles(Server.MapPath("~/Uploads/2012/emp/")) Dim files As List(Of ListItem) = New List(Of ListItem) For Each filePath2 As String In filePaths files.Add(New ListItem(Path.GetFileName(filePath), filePath)) Next gvEmp.DataSource = files gvEmp.DataBind()
What I want to do is to get only one file per user as the fileID along with the location is saved in for every user. I ran a query to get the fileLocation and pass that location stored in the database instead of the current server path but I can't figure out how I would do it.
I am new at ASP.NET and I am having some difficulties. What I have below is a Registration and Login, both in one page. However, when a user is logged in, I would like the registration and login form to be hided. There is a LOGOUT option when the user is logged in.
Right now, I have all the employees of my company login to an external website using the company id, username and a password. We are trying to integrate it into an intranet portal which should provide seamless access to this website without requiring the user to enter these credentials.
Is there any way of doing this programmatically (.NET C#)? Very similar to screenscraping, Can I simulate the appropriate POST action and then redirect the user to the logged in page?