How to Redirect the aspx page using forms authentication

Posted by Kavi.Sirius under ASP.NET on 5/7/2012 | Points: 10 | Views : 1763 | Status : [Member] | Replies : 1
hi,

i am using the forms authetication in my web application.

but its not redirect to the some another aspx page

my code

FormsAuthentication.RedirectFromLoginPage("login.aspx", false);


but its not redirect to the login.aspx page .
its redirect to default.aspx page



Thanks in advance

Regards
Kavi.n



Responses

Posted by: Funda on: 5/8/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
What you are trying is not advisable,
FormsAuthentication.RedirectFromLoginPage :
Redirects an authenticated user back to the originally requested URL or the default URL.
So the Orignally requested URL or the default URL will be referred in Web.Config
<system.web>

<authentication mode="Forms">
<forms loginUrl="Logon.aspx" name=".ASPXFORMSAUTH">
</forms>
</authentication>
<authorization>
</authorization>
</system.web>

Try Something like this
FormsAuthentication.RedirectFromLoginPage (UserEmail.Text, bool);


This will re directed to Logon.aspx if the credential are Ok
Thanks


Kavi.Sirius, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response