I am developing login page for my asp.net application. I am using Formsauthentication class. Login page consist of login button and forgot password link button. Login button redirects to default page on valid login which is working as needed. But for forgot password button click, on clicking on this button, the page is not redirecting to forgot password page. On click of Login button after click on forgot password, however, page is being redirected to forgot password page.
my login page code is :
protected void btnSelect_ServerClick(object sender, EventArgs e)
{
FormsAuthentication.RedirectFromLoginPage(userId, false);
}
my code in forgot password link button is:
protected void lnkForgotPassword_Click(object sender, EventArgs e)
{
Response.Redirect("ForgotPassword.aspx");
}
On click of forgotpassword, url shown in address bar is
http://localhost:2040/GUI/Login.aspx?ReturnUrl=%2fGUI%2fForgotPassword.aspx[
^] but page is not being redirected.
My web.config file is:
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" defaultUrl="~/GUI/CompanySelect.aspx" loginUrl="~/GUI/Login.aspx" requireSSL="false" protection="All" slidingExpiration="true" path="/" enableCrossAppRedirects="false"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<location path="~/GUI/ForgotPassword.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
how can I redirect to forgot password page on click of forgot password link? any help? Thanks in advance...