This question was kind of touched before but not the answer I was looking for.
I am using the IIS7 URL Rewrite module to rewrite my pages, and now my asp.net login form does not work!!!
On my master page I have this (ASP.Net 3.5 SP1 feature)…
if (!String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_ORIGINAL_URL"]))
{
form1.Action = Request.ServerVariables["HTTP_X_ORIGINAL_URL"];
}
Which makes the page post back to the currently rewritten page.
However my login control just post backs without firing ANY events. Therefore it does not log in, the onlogginerror etc events don't fire, nothing!!
I have tried this…
if (!String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_ORIGINAL_URL"]))
{
Login Login1 = LoginView1.FindControl("Login1") as Login;
if (Login1 != null)
Login1.DestinationPageUrl = Request.ServerVariables["HTTP_X_ORIGINAL_URL"];
}
ith no avail…
Please also note I am using the CSS Friendly Adapters for my login control, and even tried changing this line here from…
PostBackOptions options = new PostBackOptions(btn, "", "", false, false, false, clientSubmit, true, login.UniqueID);
to…
PostBackOptions options = new PostBackOptions(btn, "", HttpContext.Current.Request.ServerVariables["HTTP_X_ORIGINAL_URL"], false, false, false, clientSubmit, true, login.UniqueID);
with no avail…
Please help 🙁
Best Answer
Sorry spoke too soon...
As mentioned in another topic, this web site has the solution.
Just basically add the
App_Browser
file, and create the form rewriter file.Form.browser:
FormRewriter.cs: