I am making an application in ASP .NET where I am logging in with drivers. However in the login page when I click on the hyperlink to make recover password the control does not leave the login page and I am not redirected to the page of recover password. If I see the URL it changes the url to recoverpassword.aspx but the recover page does not appear and I do not leave the login page. Can someone help me figure out why? Thank you.
Code in the default.aspx page:
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.Page.User.Identity.IsAuthenticated)
{
FormsAuthentication.RedirectToLoginPage();
}
else if (this.Page.User.IsInRole("Saba") || this.Page.User.IsInRole("CorpAdmin") )
{
//Server.Transfer("Report/ListSabaReports.aspx", true);
Response.Redirect("~/Report/ListSabaReports.aspx");
}
else if (this.Page.User.IsInRole("SumTotal"))
{
//Server.Transfer("Report/ListSumTotalReports.aspx", true);
Response.Redirect("~/Report/ListSumTotalReports.aspx");
}
else if (this.Page.User.IsInRole("X-Domain"))
{
//Server.Transfer("Report/ListSabaReports.aspx", true);
Response.Redirect("~/Report/ListSabaReports.aspx");
}
}
}
Code in web config:
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting"
assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</controls>
</pages>
I WANTED TO BE AT THE LOGIN PAGE THAT I HAVE THERE A HYPERLINK WITH THE TEXT RECOVERPASSWORD AND I WANTED TO BE REDIRECTED TO THIS PAGE BUT I CAN NOT ALWAYS BE ON THE LOGIN PAGE. SOMEBODY HELP ME