473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Customize Error Page

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
1 1433
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1158
by: Amy Snyder | last post by:
I have a datagrid where I incorporate paging and sorting. My datagrid page mode is set to numeric. Is there a way for me to customize this to display something like this in the page header: ...
1
1187
by: henry | last post by:
Hi all, When user upload a file, there is a size limit (default is 4M). And we can change this size limit by changging the config file. If a user upload a file bigger than this size, an DNS...
5
1911
by: Sun Jian | last post by:
Hi, I am trying to customize the asp.net validation to achieve the following: Upon submitting the form, client side validation will run, and it will stop at the first error detected. For...
0
1806
by: Ray | last post by:
I am trying to add a "Next >" and "<Prev" button to the pager of my datagrid. I have been able to add the hyperlinks to the pager. I am now trying to determine the correct postback script to...
1
2675
by: JuanCarlos Gomez | last post by:
I am try to customize papersize on VBNET (PrintDialog, PritnDocument), but only have access to defined Paper Size on my Printer (FX-2180), how I can customize papersize and use it. Because all the...
1
300
by: Shabam | last post by:
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...
7
5038
by: DC | last post by:
Hi, there is a 500;13 page one can configure in the website properties, but ..Net Framework 1.1 also delivers the "server too busy" message sometimes and the IIS custom error page does not seem...
1
1381
by: Alex | last post by:
Hello, When an error occurs, is it possible to customize the message abit? For example, currently after Source Error and Stack Trace it shows Version Information, but can I add the Machine IP...
4
1228
by: Michael | last post by:
I am considering building my WebForm page using Web Parts, so that my users can customize Web application's user interface. Is there any good information on it? or step by step demo?
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.