473,566 Members | 2,958 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 1445
One approach would be to catch the error from the Application_Err or
procedure in your Global.asax file. e.g.:

protected void Application_Err or(Object sender, EventArgs e)
{
Exception ex = Server.GetLastE rror();
if (ex is HttpRequestVali dationException )
{
// Do one thing.
}
else
{
// Do something else.
}
}

HTH,
Nicole
"Shabam" <xx***********@ hotmail.com> wrote in message
news:Jc******** ************@ad elphia.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
1166
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: Page 1 of 20 Display 50 rows per page The 1 would be in a text box that could be changed from 1-20 to go directly to the page. The 50 would be...
1
1192
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 error will be displayed. Now my question is whether we can customize this error message? Displaying a DNS error page is quite misleading to normal...
5
1916
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 example if both UserID and Password text fields are required but neither is filled in, I'd like to display the error message (a dialogbox) "Please enter...
0
1812
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 emulate so that these hyperlinks force the postback of the appropriate linkbuttons in the pager. Let's take a pager with pager: 1 2 3 4 5 It consists...
1
2679
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 time have access only to the defined paper. I need create an paper size (not ISO's). Please help me
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 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...
7
5049
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 to catch that. How would I customize the error page then? Regards DC
1
1389
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 Address and Currently Logged In Username to this as well? Possibly even the Server IP? This would greatly help us track down where the error...
4
1237
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
7584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7645
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7953
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5485
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.