Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sir,
In my project, i have a page where i can add user & the data is save in a database & data fields are

Emp_id, Employee_code, First_name,Last_name, Gender, User_name, Password, ConformPass, mailid, Role,

Now, I want to set different role for every user(ex. admin, user and staff), so give me how to set the role for different users and please give me the query for that also, if you having it.

please help me ..i am new in asp.net
Posted
Comments
prodipjsr 13-Apr-13 2:41am    
Dear Sir's,
Still i am waiting for ur ans..if u hv any example with code please send me @ prodipjsr@gmail.com...

create a table called UserTypes with following fields:

user_type_id, user_type, creation_date, updation_date, is_enable


e.g 1, Admin, Date, Date, Y


and create also table called Roles in which different user to be assigne role:

role_id, role_name, creation_date, updation_date

e.g LOCALRI00000001, Admin, Date, Date


to update a role or user use updation query on submit button.
Actually, u have to create a MasterPage in that two link should be their
e.g. User, Roles, Employees.
 
Share this answer
 
v2
Comments
prodipjsr 12-Apr-13 6:57am    
ok i will create the table in my database, but how can set the role for a user!! say user the cant access all the page in my project. but admin can access all page in my project...please help me..if u have any code..
Member 2707515 12-Apr-13 7:25am    
Follow Link:
http://www.flickr.com/photos/94899243@N04/
Member 2707515 12-Apr-13 7:08am    
create a page Employee where u entered all employee detail their only a option for assing a role and which kind of users.
Member 2707515 12-Apr-13 7:09am    
can u provide ur emailid i send u a image of ma project
prodipjsr 12-Apr-13 7:24am    
i have create the page & i can insert user information with role into my table. now my question is how i can set access power for a user. Say i have 3 page in my web project. (i)create user, (ii)log in (iii)Transaction page. Now i have 3 user (a)admin (b)user (c) super user.
now how i set if the log in user is "user" then he cant access the page "(i)create user" or Transaction page. i hope u got my point..my mail id is..
prodipjsr@gmail.com
As a beginner I would suggest you to go with ASP-NET-Roles-and-Membership.

Using asp.net's Role feature , you can minimize all the Database table and Stored procedure creation work . ASP.Net will create and manage all that for you .
You will be provided with a Admin UI , and you can well manage the login , registrations and the user page access roles .


Hope it helps

[ Happy Coding ]
 
Share this answer
 
Comments
prodipjsr 12-Apr-13 8:38am    
i understand.. but where is the code..???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900