Redirecting the Users to different pages based on there roles
while working with login control , you can redirect the users to a different pages base on there roles , to do this , you need to handle theLoggedIn event for login control which is fired after the user logged in successfully ,
Assume we have 2 roles , Admins and Editors ..
and assume that every role has its own directory ,
you can check the user role and redirect the user in the loggedIn event handler of the Login control as follows:
protected void Login1_LoggedIn(object sender, EventArgs e) {
if(Roles.IsUserInRole("Admins"))
Response.Redirect("~/Admins/Default.aspx");
else if(Roles.IsUserInRole("Editors"))
Response.Redirect("~/Editors/Default.aspx");
}
Regards,
Anas Ghanem