Click here to Skip to main content
14,691,000 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi guys..
I am created Application ,In which i developed LogIn a related form,But i want to identify LogIn as Admin or simple user And how distinguish or redirect user based on his role to specific form
I designed Table User in SQL-Server but how to identify specific.Role or User??
Help me please..If this question is not appropriate then update it
Thank you
Ankur\m/ 16-Sep-13 1:10am
Are you using ASP.NET membership provider or custom membership provider?
indrajeet jadhav 16-Sep-13 1:15am
I am currently not using any membership provider..i Have to identify User based on On Specific value on Table Just like ID or any string..

Look into this article. It will give you the idea how to implement security related details.

Authenticate User by Roles in ASP.NET[^]
I created Role table
2.RoleName //Admin Or Normal User or what is the role name we can add it
3.Active bit // for true or false

I pass this RoleID in User Table as a FK

and in In login Form

if (LoginMsg[2].ToString() == "Admin") //If admin logs in then here
Session["UID"] = LoginMsg[1].ToString();
Session["ADMINID"] = LoginMsg[1].ToString();
Response.Redirect("Redirecting page of Admin Section", false);
else //Other user than admin
Session["UID"] = LoginMsg[1].ToString();
Response.Redirect("redirecting page user page",false);
I really thanxx and Appreciate the people Rohan Leuva and ArunRajendra who help me
indrajeet jadhav 16-Sep-13 2:10am
I really thanxx and Appreciate the people Rohan Leuva and ArunRajendra who help me

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