asp.net 2.0里好像还真不能。 asp.net mvc 2.0里倒是可以: this.ValidateRequest = false;
查了一下,好像还真不能在cs代码里设置,不过貌似可以用这样的方法绕过去protected void Page_Error(object sender, EventArgs e) { Exception ex = Server.GetLastError(); if (ex is HttpRequestValidationException){ Server.ClearError(); } }
.cs里面就是:Page.ValidateRequest = false;
asp.net mvc 2.0里倒是可以:
this.ValidateRequest = false;
{
Exception ex = Server.GetLastError();
if (ex is HttpRequestValidationException){
Server.ClearError();
}
}