AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 how to give access to pages and for controls in asp.net2.0 with c#
Posted by charan on  3/17/2010 6:21:54 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
hi, iam using asp.net2.0 with c# with sql server

the table fields are as follows

username nvarchar
password nvarchar
emailid nvarchar
usertype int(1=administrator,2=programmer,3=manager,4=user)
active bit

so based on the user types how to give access on each page and on controls like buttons. and for different users different permissions .can you give me example which helps me

Post Your Reply Post New Question

 Viewer's Reply
User Access Rights to Web Pages
Answered By Moderator1 on 3/19/2010 10:20:48 PM
Hi,

There is no specific way to code this. It totally depends on the system requirement. I can provide you some logic, and you can try to code it.
The UserType is the Type of Users Login into the System. So every usertype must have a role to play inside the system. So you need another database Table as "UserRoles". This table must have columns such as PageID, PageName or URL, UserType, AddRights, EditRights, DeleteRights..So every Page will have page id, when user login, you can check this table with UserType and PageId and retrieve the rights, then you can enable or disable the buttons inside the page..
Its a raw logic...so try to develop and if you any questions post it below this reply..
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Introduction to Web Applications Development
Windows 8: 50 Questions and Answers You Need to Make a Decision (Normally $9.95)
When Good HTML Goes Bad: How You Can Protect Your Web Applications