I have a standard forms auth ASP.NET application. My Registration and Login page are in the same .aspx file with 2 jQuery Mobile pages. If I postback my ASP.NET page, such as the user fails to login correctly...etc The Url hash starts appending to itself over and over.
Example Url:
http://localhost:56644/Register.aspx?ReturnUrl=%2fDefault.aspx%3fbla%3dtest&bla=test#Register.aspx?ReturnUrl=%2fDefault.aspx%3fbla%3dtest&bla=test
Once my user is authenticated I want to Redirect to the ReturnUrl without all the hash information or find a way for the url to remain during postbacks?
Markup:
<div data-role="page" id="register">
<div data-role="content" data-scroll="true" data-theme="b" class="Content">
......
<a href='#login'>Login</a
</div>
</div>
<div data-role="page" id="login">
<div data-role="content" data-scroll="true" data-theme="b" class="Content">
.....
<a href='#register' >Registered Yet?</a>
</div>
</div>
Code-behind on Register.aspx:
protected void btnLogin_Click(object sender, EventArgs e)
{
if (LoggedIn)
{
FormsAuthentication.SetAuthCookie("blabla", true);
//Note: Request.QueryString["ReturnUrl"] = "/Default.aspx?bla=test";
Response.Redirect(Request.QueryString["ReturnUrl"]);
}
}