473,779 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpServerUtili ty.GetLastError Timing issue?

Looking for some clarification here. I'm considering using
HttpServerUtili ty.GetLastError in a standard errorhandler
for all my pages. (Inherits System.Web.UI.P age and
overrides OnError.) My concern is that I think there MAY
be a timing issue with the GetLastError method as it is a
method of the HttpSERVERUtili ty class.
When an exception is thrown within a page and triggers the
OnError method, how am I guaranteed that the exception
returned by GetLastError is the same exception that
triggered the OnError method? It seems to me, from the
location of the GetLastError method, that, if 2 pages
threw exceptions at just the right times, I could be
handling the wrong exceptions.
Thanks for any assistance.
Nov 18 '05 #1
1 1712
there is no problem. aspx page processing is context bound, and the
GetLastError uses the current context to get the error message, simular to
the Session Cache.

-- bruce (sqlwork.com)
"Brendan Erwin" <be****@info1te am.com> wrote in message
news:0c******** *************** *****@phx.gbl.. .
Looking for some clarification here. I'm considering using
HttpServerUtili ty.GetLastError in a standard errorhandler
for all my pages. (Inherits System.Web.UI.P age and
overrides OnError.) My concern is that I think there MAY
be a timing issue with the GetLastError method as it is a
method of the HttpSERVERUtili ty class.
When an exception is thrown within a page and triggers the
OnError method, how am I guaranteed that the exception
returned by GetLastError is the same exception that
triggered the OnError method? It seems to me, from the
location of the GetLastError method, that, if 2 pages
threw exceptions at just the right times, I could be
handling the wrong exceptions.
Thanks for any assistance.

Nov 18 '05 #2

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

Similar topics

1
1652
by: SilverlineDesign | last post by:
I am having trouble using Server.GetLastError() on my asp.net pages. I defines a standard error page in my web.config to handle all site errors, but the page that is supposed to handle the error creates an error itself. Whenever I try to retrieve the last made error with Server.GetLastError() will retrieve a null result, so if I try to print out something like Server.GetLastError().ToString() the page will spit out a nullreference exception....
3
8133
by: Russell | last post by:
I have a quirky issue that I believe involves timing and only 2 hairs left to pull. I have a modal dialog that is an IFrame. The IFrame contains another window - which contains the appropriate title. I am trying to change the title of the IFrame window to be that of the contained window title. If I uncomment the alert statement below - the title change works. Comment out the alert - and - no title change.
7
2196
by: Jacob Barnett | last post by:
Access 2000 main report does not display subreport data in preview and may or may not print... sometimes. Usually, the entire report is fine. The behavior does not seem to depend on particular records or data and I have not found a reliable way to reproduce the behavior. The subreport can always be generated independently and always prints. There is data in both the main report and the subreport. The link child and master fields are...
4
2645
by: Brian Hanson | last post by:
Hi, I have a problem that is sporadic and am thinking it may come down to a timing issue. I have an asp.net (vb) app that used the system.io.file.copy method to copy a .pdf file from a network drive to the local server drive. From there I use that .pdf file to create another .pdf file using a tool from ActivePDF. The problem I have is that one out of 8 or 10 times I get an error: Access to the path "c:\ActivePDF\watever.pdf" is...
2
2137
by: Lars Netzel | last post by:
I'm trying to make my own custom error page... but when using Try lblErrormessage.Text = Server.GetLastError.Message lblErrormessage.Text += "<br>" & Server.GetLastError.StackTrace lblErrormessage.Text += "<br>" & Server.GetLastError.Source Catch ex As Exception
1
2454
by: robertlair | last post by:
I am having issues with a production server with the GetLastError() method. Here is what I am doing: Application_Error on Global ASAX: Note: I am doing it this way (with ClearError) because while researching, someone on a post said that Session state would not persist unless I cleared the error... didn't make sense, but it also didn't work before I put this in there too.
2
1426
by: Alexander | last post by:
I wanna to transfer from one HttpHandler (HttpModule) to another one. When I doing HttpContext.Current.Server.Transfer("~/OtherHandler.ashx") from my handler I see: System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +3179617...
2
5906
by: Patrick F | last post by:
I have a dll file that i am trying to use the Server.Encode function. so i have added a reference to System.Web; but when im trying to delcare: HttpServerUtility mServer = new HttpServerUtility(); return mServer.HtmlEncode(strValue); i get the following error: Error The type 'System.Web.HttpServerUtility' has no constructors defined
2
1548
by: julie.siebel | last post by:
Google apparently ate my original post to this (grr) so this'll be a bit more vague than the initial post, but...*sigh*. Javascript is not my forte, and I apologize for the acky-ness of the code. I'm working on a page for a travel company. There's way too much going on with it/on it, but I'm kind of stuck at this point - the client loves it, so I have to solve this problem.
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9931
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7485
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
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 we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.