469,323 Members | 1,599 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

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 1954
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
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.