T
teo
I have to validate the user input
to prvent HTML injection.
I use validateRequest=True
and when a potentially malicious input occurs
AspNet immediately sends its ugly page
about the 'System.Web.HttpRequestValidationException',
a difficult to understand page and that compels the user
to go back to the previous page with his browser's button.
So I decided to manually track the Exception
in the Page_Error with this:
If ex.GetType().ToString() = "System.Web.HttpRequestValidationException"
Then
Response.Redirect("myPage.aspx")
End If.
But the Response.Redirect, Server.Transfer, Server.Execute commands
generate the ThreadAbortException error .
You can't avoid this, see 'Article ID : 312629' .
Also the Response.Redirect("myPage.aspx", False) command
is unuseful because the ugly page appears at last
(because the 'False' parameter allows the code to be processed
so the ugly page appears).
So what can I do?
----------------
Also,
how do you call another page
from within your code
if the Response.Redirect, Server.Transfer, Server.Execute
generate the ThreadAbortException error ?
to prvent HTML injection.
I use validateRequest=True
and when a potentially malicious input occurs
AspNet immediately sends its ugly page
about the 'System.Web.HttpRequestValidationException',
a difficult to understand page and that compels the user
to go back to the previous page with his browser's button.
So I decided to manually track the Exception
in the Page_Error with this:
If ex.GetType().ToString() = "System.Web.HttpRequestValidationException"
Then
Response.Redirect("myPage.aspx")
End If.
But the Response.Redirect, Server.Transfer, Server.Execute commands
generate the ThreadAbortException error .
You can't avoid this, see 'Article ID : 312629' .
Also the Response.Redirect("myPage.aspx", False) command
is unuseful because the ugly page appears at last
(because the 'False' parameter allows the code to be processed
so the ugly page appears).
So what can I do?
----------------
Also,
how do you call another page
from within your code
if the Response.Redirect, Server.Transfer, Server.Execute
generate the ThreadAbortException error ?