c# 4.0 - How to catch HttpRequestValidationException -


how can redirect user custom error page, when httprequestvalidationexception occurred. tried catch in basecontroller :

protected override void onexception(exceptioncontext exceptioncontext)     {       if (exceptioncontext.exception httprequestvalidationexception)         {           this.view("customerror").executeresult(this.controllercontext);         }     } 

but still exception : potentially dangerous request.form value detected client

this exception occurs earlier in execution of request , cannot handled onexceptionmethod in base controller. write global exception handler showed in this post.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -