Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 18, 2008 06:58 AM by email@example.com
Feb 26, 2007 09:09 PM|LINK
now I enabled roles, but I have the same problem, when a user logs in the user depends to a role. How can I configure that role1 should be redirected to side1 and role2 should be redirected to side2?
Feb 26, 2007 09:18 PM|LINK
Have you assigned user1 to role1?
If so you do this:
Feb 26, 2007 09:35 PM|LINK
I had done it like that:
But no matter which user and pass I try I will always be forwarded to page1? What I am doing wrong now?
Feb 26, 2007 09:49 PM|LINK
First you are using the wrong event. Use the LoggedIn Event.
Then do this:
protected void Login1_LoggedIn(object sender, EventArgs e)
else if (Roles.IsUserInRole("role2"))
Feb 26, 2007 10:14 PM|LINK
my app is in VB, so I changed your code to:
But now always the page3.aspx is shown. Not the page1 or page2. I read that the result will only after a postback be true. How can I realize a pageback before this sub is running?
Feb 26, 2007 10:39 PM|LINK
Try replacing this : Roles.IsUserInRole("role1")
with this : Roles.IsUserInRole(((System.Web.UI.WebControls.Login)sender).UserName, "role1");
Feb 26, 2007 10:52 PM|LINK
we made it ;-)). But it was easier than with your one. The following code works now perfectly:
Many thanks for all your help!!!
Wish you a nice day, Chris
Feb 26, 2007 11:19 PM|LINK
I am glad it worked :).
Feb 26, 2007 11:55 PM|LINK
Jul 10, 2008 12:18 PM|LINK
i also want to redirect user based on my role
but it is not working and for the admin role it is always redrected to root's default.aspx.
when i directly access my admin's any page for example
it is rediredcted to signup.aspx page,its ok,but when i use the
signup.aspx page it always redirected to root default.aspx page which i have not coded like this,
my signup.aspx.cs file is
so please tell me how can i redirect to admin folder's AddNews.aspx
page from my login page?