473,756 Members | 3,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GetLastError fails to get error

I am having trouble using Server.GetLastE rror() 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.GetLastE rror() will retrieve a null result, so if I try to print out something like Server.GetLastE rror().ToString () the page will spit out a nullreference exception.

I have no ideas on how to get this to work, I have tried different uses of Server.GetLastE rror with and without () but nothing seems to help.

Does anybody have expierence or has anybody heard about this problem?

Thanks in advance,
Jan van der Veen
Jul 21 '05 #1
1 1648
try to use Server.GetLastE rror() in the Application_Err or event in the Global.asax.

"SilverlineDesi gn" wrote:
I am having trouble using Server.GetLastE rror() 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.GetLastE rror() will retrieve a null result, so if I try to print out something like Server.GetLastE rror().ToString () the page will spit out a nullreference exception.

I have no ideas on how to get this to work, I have tried different uses of Server.GetLastE rror with and without () but nothing seems to help.

Does anybody have expierence or has anybody heard about this problem?

Thanks in advance,
Jan van der Veen

Jul 21 '05 #2

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

Similar topics

1
1813
by: Nick Messick | last post by:
The original programmer of our website put "on error resume next" on every page to cover up his lack of skill. Many of our pages are returning errors that we never see. I want to make a little script that emails me at the occurance of an error. I copied one that used the Err object but I don't want to use it because I would like line numbers is the email. I then copied our custom 500 error page that uses the GetLastError function...
3
8315
by: ad | last post by:
I use GenericErrorPage.aspx for the redirect page when some error occur. I want to show some different according error statusCode . How can I get error statusCode form Server.GetLastError()?
1
2410
by: Dave | last post by:
Hi I want to know if it's possible to user Server.GetLastError() in my AppError.aspx below? The GetLastError is not available here and returns null. I'm using Application_Error event to send an email, but I also want to create a custom error page in the AppError.aspx that displays some of the error message. Do I have to preserve the error message in the Application_Error event <customErrors mode="On" defaultRedirect="AppError.aspx"/> ...
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
6
4603
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my form: ========
4
4135
by: VK | last post by:
Hello, I am trying to get the last occured error via the following code: Sub Page_Load(...) Dim zero As Integer = 0 Try Dim err As Integer = 10 / zero Catch ex As Exception
1
2449
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.
1
298
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....
2
12215
by: Seguros Catatumbo | last post by:
Hello guys, i am trying to port my custom asp 3.0 error page to asp.net. I want to disable debugging in my asp.net projects but i want to show the users a pretty page but that page should send me an email with the details of the error. On classic asp i just went to iis and mapped the 500 error code to error.asp, which does this: set objError = Server.getLastError()
0
9271
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10031
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
9708
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
8709
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
7242
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
6534
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
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
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
3354
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.