hi...
i want to know how can i define roles in web config .
i have a logintable (name,password,userrole) and userrole is of three types (admin,teacher,student).... and my website have three folder according to my role ...
now i have written something like below in web.config...
<pre lang="HTML">
<location path="Admin">
<system.web>
<authorization>
<allow roles="Admin" />
<deny roles="*" />
</authorization>
</system.web>
</location>
<location path="Teacher">
<system.web>
<authorization>
<allow roles="Teacher" />
<deny roles="*" />
</authorization>
</system.web>
</location>
<location path="Student">
<system.web>
<authorization>
<allow roles="Student" />
<deny roles="*" />
</authorization>
</system.web>
</location>
and in login page i have code like below ....
if (Roles.IsUserInRole("Admin"))
{
Response.Redirect("~/Admin/Default.aspx");
}
if (Roles.IsUserInRole("Teacher"))
{
Response.Redirect("~/Teacher/Default.aspx");
}
if (Roles.IsUserInRole("Student"))
{
Response.Redirect("~/Student/Default.aspx");
}
but my code does not execute any of above condition...Please help me and tell me how can i manage my roles in login page to web config page ..
can i create role in web config then please tell me how ...
please help me .....