473,388 Members | 1,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

GetLastError

dev
Hi all,
Win2k IIS5
I am trying to capture some information about 404 errors occurring on our
website. I have defined a custom error page in IIS5 using the properties of
the site. I am creating a 404 error by mistyping an address. The custom
404 page is called, but there is no data in Server.GetLastError.

Code:
Dim objError
Set objError = Server.GetLastError()
strNumber = objError.AspCode
strSource = objError.Category
strPage = objError.File
strDesc = objError.Description

What have I missed?

TIA,
Steve
Jul 19 '05 #1
1 2064
Server.GetLastError only occurs for 500 errors, and can only be called in
the custom error page designated for 500 errors.
http://www.aspfaq.com/2335

404s are handled differently. You can get some ideas here.
http://www.aspfaq.com/2162

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"dev" <me@you.com> wrote in message
news:eP**************@TK2MSFTNGP10.phx.gbl...
Hi all,
Win2k IIS5
I am trying to capture some information about 404 errors occurring on our
website. I have defined a custom error page in IIS5 using the properties of the site. I am creating a 404 error by mistyping an address. The custom
404 page is called, but there is no data in Server.GetLastError.

Code:
Dim objError
Set objError = Server.GetLastError()
strNumber = objError.AspCode
strSource = objError.Category
strPage = objError.File
strDesc = objError.Description

What have I missed?

TIA,
Steve

Jul 19 '05 #2

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

Similar topics

1
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...
1
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...
3
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
by: Brendan Erwin | last post by:
Looking for some clarification here. I'm considering using HttpServerUtility.GetLastError in a standard errorhandler for all my pages. (Inherits System.Web.UI.Page and overrides OnError.) My...
1
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...
2
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 ...
6
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...
4
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
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.