473,503 Members | 3,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page_Error

APA
I have the following error handler on my page:

public void Page_Error(object sender,EventArgs e)
{
System.Exception appException = Server.GetLastError();
HttpException checkException = (HttpException)appException;
if ((checkException.ErrorCode == -2147467259))
{
HttpContext.Current.Server.ClearError();
FileSizeUploadError = true; //class level private variable
}

}
It's used to detect uploaded file size errors. It traps the error fine but
once the event handler completes nothing else on the page is processed and I
receive a "The page cannot be displayed" message in my browser. Why is it
not completing my page?


May 15 '06 #1
1 1296
if the browser uploads a file over the limit, the only why to tell the
browser is for the server to close the connection. The browser then reports
an error (of its choice). There is no response, and the request never
completed (from the browsers point of view). becuase the connection is
killed, so is the processing request as it can not write any data back to
the browser.
-- bruce (sqlwork.com)

"APA" <bu**********@iqasylum.com> wrote in message
news:Oc**************@TK2MSFTNGP03.phx.gbl...
I have the following error handler on my page:

public void Page_Error(object sender,EventArgs e)
{
System.Exception appException = Server.GetLastError();
HttpException checkException = (HttpException)appException;
if ((checkException.ErrorCode == -2147467259))
{
HttpContext.Current.Server.ClearError();
FileSizeUploadError = true; //class level private variable
}

}
It's used to detect uploaded file size errors. It traps the error fine
but
once the event handler completes nothing else on the page is processed and
I
receive a "The page cannot be displayed" message in my browser. Why is it
not completing my page?

May 15 '06 #2

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

Similar topics

2
4116
by: Tee | last post by:
what's the differences between "Overrides Sub OnError" and "Sub Page_Error" ?
2
2794
by: fump75 | last post by:
Hello, I would like to show an error message in a user control when an exception is thrown. This message should be built in Page_error or Application_error event and i don't manage to reach a...
4
6203
by: Alex Nitulescu | last post by:
Hi. I read about Page_Error and Application_Error. However, I provoke an error in a page but still Page_Error won't run. This is all the code I have left in my page: ...
1
3698
by: Buddy Ackerman | last post by:
I have a page where users upload files. I have the maxRequestLength set and have created a Page_Error procedure to trap the error when someone load a file that is larger than the maxRequestLength....
2
2104
by: Carl Johansen | last post by:
I've been reading the O'Reilly "ASP.NET Cookbook" 1st edition (Kittel and LeBlond), and it makes a recommendation about exception handling that seems a bit strange. They say that, if you want to...
6
4544
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
2115
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
1164
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...
3
1255
by: Carlo Razzeto | last post by:
Is there anyway to inline Page_Error type global error handling in an ASP.Net webpage? Currently I work on a very large web system where the entier web front end is contained in a single project...
2
1433
by: Erik Lautier | last post by:
I've got Page_Error emailing me the message and stack trace when a server error is generated, but it doesn't always work. My Page_Error code: Sub Page_Error(ByVal src As Object, ByVal args As...
0
7192
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
7064
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
7315
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...
0
5559
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
4991
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
4665
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
3158
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
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
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.