protected
override
void
OnError(EventArgs e)
{
Exception lastException=this.Server.GetLastError();
determin if it is HttpRequestValidationException#region determin if it is HttpRequestValidationException
if ( lastException is HttpRequestValidationException)
{
string returnJS = string.Format( "<script>alert('{0}');window.history.back();</script>", Accor.Vel.CoreToolKit.Utilities.Language.GetResource("InputError", this.Page ) );
this.Page.RegisterStartupScript( Guid.NewGuid().ToString().Replace("-",""), returnJS );
Response.Write( returnJS );
Server.ClearError();
return ;
}
}
{
Exception lastException=this.Server.GetLastError();
determin if it is HttpRequestValidationException#region determin if it is HttpRequestValidationException
if ( lastException is HttpRequestValidationException)
{
string returnJS = string.Format( "<script>alert('{0}');window.history.back();</script>", Accor.Vel.CoreToolKit.Utilities.Language.GetResource("InputError", this.Page ) );
this.Page.RegisterStartupScript( Guid.NewGuid().ToString().Replace("-",""), returnJS );
Response.Write( returnJS );
Server.ClearError();
return ;
}
}
在pagebase里面,catch住HttpRequestValidationException,处理一把就可以了~