473,769 Members | 2,124 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 1711
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
1651
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
8132
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
2195
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
2644
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
2135
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
2450
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
1547
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
10210
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9860
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...
0
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
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
5297
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...
1
3955
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
3
2814
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.