By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,627 Members | 2,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,627 IT Pros & Developers. It's quick & easy.

Customize Error Page

P: n/a
When I set validateRequest="true", and a user tries to submit html into the
form, the server returns with a huge error page detailing what wasn't
allowed.

Is there a way to customize just this error page to something more friendly?
I want to use different error pages for other things, but for this one I'd
like to customize it. Is this possible?
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
One approach would be to catch the error from the Application_Error
procedure in your Global.asax file. e.g.:

protected void Application_Error(Object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
if (ex is HttpRequestValidationException)
{
// Do one thing.
}
else
{
// Do something else.
}
}

HTH,
Nicole
"Shabam" <xx***********@hotmail.com> wrote in message
news:Jc********************@adelphia.com...
When I set validateRequest="true", and a user tries to submit html into
the
form, the server returns with a huge error page detailing what wasn't
allowed.

Is there a way to customize just this error page to something more
friendly?
I want to use different error pages for other things, but for this one I'd
like to customize it. Is this possible?

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.