Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Dear Frnds,

I have given user roles in database. which person which screen will accesss... how to implement in asp.net c# code. I am new to this technology please can we help me..
Posted
Comments
TrushnaK 12-Feb-14 5:35am    
which fields you have taken in database for user role..
vignesh war 12-Feb-14 5:44am    
for Screen Name, user Name, Access is field name. values for eg. Front office, Vino, Yes
Like this..
vignesh war 12-Feb-14 5:45am    
access field is yes then that screen is visible for that user

1 solution

ok check user rights in every pages page load method like:-
C#
protected void Page_Load(object sender, System.EventArgs e)
{
  //write query here which checks your Access field (where screen name and user name)
  if (isPermitted == "yes")
  {
     //your regular code
  } 
  else
  {
    response.redirect("~/Home.aspx")
   }
}
 
Share this answer
 

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