473,473 Members | 4,176 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why Page_Error can't catch an HttpRequestValidationException?

I have the following code in Page_Error handler subroutine:

Exception ex =Server.GetLastError();
Response.Write(ex.Message);
Response.Write(ex.StackTrace);
Server.ClearError();

But it doesn't work when an HttpRequestValidationException occurs(I input a
html tag into the TextBox control in the page and submit it).I have attach
the Page.Error event to it's handler--the Page_Error subroutine.the same
code in the Application_Error works well.Why?
Nov 18 '05 #1
1 2230
It would make sense having ASP.NET to perform this check before loading the
page... (you can check the call stack to make sure).

Patrice

"bondzhou" <zh*********@sohu.com> a écrit dans le message de
news:uJ*************@TK2MSFTNGP11.phx.gbl...
I have the following code in Page_Error handler subroutine:

Exception ex =Server.GetLastError();
Response.Write(ex.Message);
Response.Write(ex.StackTrace);
Server.ClearError();

But it doesn't work when an HttpRequestValidationException occurs(I input a html tag into the TextBox control in the page and submit it).I have attach
the Page.Error event to it's handler--the Page_Error subroutine.the same
code in the Application_Error works well.Why?

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James Zhou | last post by:
I have the following code in a Page_Error handler : Exception ex =Server.GetLastError(); Response.Write(ex.Message); Response.Write(ex.StackTrace); Server.ClearError(); But it doesn't work...
6
by: Matt | last post by:
Can anyone give me a good reason to use BOTH application scope Page_Error and the page scope Page_Error when trapping errors in a web application? Is there any real benefit to using the Page_Error...
2
by: Matt | last post by:
As the subject says... are Application_Error and Page_Error triggered by the same event? In other words, is there any error that could slip by Application_Error but be caught by Page_Error, or...
0
by: slolife | last post by:
What I am trying to do is handle the HttpRequestValidationException with code, but only on pages that are equipped to handle it with special customvalidators, controls, etc.. But what I cannot...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
1
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
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.