Hello everybody,
I have this in my global.asax
void Application_BeginRequest(object sender, EventArgs e)
{
string pathAndQuery = Request.Url.PathAndQuery.ToString().ToLower();
if (pathAndQuery.Contains("prettyUrl"))
{
HttpContext.Current.RewritePath("Category.aspx?catg=uglyUrl");
}
}
it works fine, but I sometimes get this 500 unable to validate data so i guess that is because the checksum is generated on behalf of the url. which does not match the viewstate.
So how do you solve it so that you can use RewritePath
but don't get the 500 errors?
Edit forgot to mention that i have a static machinekey validationkey in the web.config
Edit2 found someone else has exactly the same problem: http://bytes.com/topic/asp-net/answers/298680-form-action-context-rewritepath#post1172026
the rewritepath causes an invalid viewstate when there is a postback