471,854 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,854 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 1998
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by SilverlineDesign | last post: by
1 post views Thread by Nick Messick | last post: by
1 post views Thread by Brendan Erwin | last post: by
1 post views Thread by Dave | last post: by
2 posts views Thread by Lars Netzel | last post: by
6 posts views Thread by José Joye | last post: by
4 posts views Thread by VK | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

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.