1
当我有这个在我的Global.asax无效的视图状态使用RewritePath
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");
}
}
它工作正常,但我有时会得到这个500无法验证数据 所以我想这是因为生成的校验代表网址。这与视图状态不匹配。
那么你如何解决这个问题,以便你可以使用RewritePath
但是没有得到500错误?
编辑忘了提,我有一个静态的machineKey的validationKey在web.config
EDIT2发现别人有完全一样的问题:http://bytes.com/topic/asp-net/answers/298680-form-action-context-rewritepath#post1172026
的rewritepath导致一个无效的视图状态时,有回传
你有你想问一个问题吗? – Sorpigal 2010-10-04 12:13:00