Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have the redirection working where the user depending on their role will go to a page that they have access to, but when they

logout or when the browser is closed and they return to the site and sign back in they go to the last page they were on instead of going to a set page where I have the code pointing to. Is there a way to stop this and have them go to the page I set for them?

What I have tried:

<asp:Login ID="LoginControl" runat="server" OnLoggingIn="LoginControl_LoggingIn">
<layouttemplate>
.....





CODE BEHIND:

protected void LoginControl_LoggingIn(object sender, System.Web.UI.WebControls.LoginCancelEventArgs e)
{
if (Page.User.IsInRole("NFI"))
{
Response.Redirect("~/AdminPages/Administration.aspx");
}

else if (Page.User.IsInRole("Partner"))
{
Response.Redirect("~/Partners/QuotePricing.aspx");
}

else if (Page.User.IsInRole("Customer"))
{
Response.Redirect("~/Customers/Customers.aspx");
}
}
Posted

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