For example i'm redirecting users to login.aspx for authentication but i want to redirect some pages to another-login.aspx is it possible?
If it is possible how can i do?
I can do it by using some codes on that pages load event but i want to know if its possible with normal authentication rules.
-
Your question isn't clear! What is exactly you want?Soner Gönül– Soner Gönül2011-11-13 00:14:04 +00:00Commented Nov 13, 2011 at 0:14
2 Answers
I could be wrong, but I don't see how this could be possible. The authentication just checks if a user is able to view a page, unless of course you had a redirect from the authentication when it failed to a different page (another-login.aspx). That is the only way that I think you could do this, but you would still be hitting the initial page (login.aspx) to check if the end user had the authority to view that page. So, I don't see the benefit in doing it this way as it would still be hitting your initial page.
Comments
The easy way I think you can achieve this is to have redirect code on your Page_Load for your main login.
Something like:
protected void Page_Load(object sender, EventArgs e)
{
if (codition1)
{
Response.Redirect(@"\Login1.aspx");
}
else if(condition2)
{
Response.Redirect(@"\Login2.aspx");
}
}