
Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
re:
!> Not 100% reliably - some browsers deliberately do not send this,
!> and some ISPs deliberately strip it from headers...
Plus, some users don't come from a referring page...
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
>> Is there a way i can find out the value of HTTP_REFERER
>
> Not 100% reliably - some browsers deliberately do not send this, and some ISPs deliberately strip it from headers...
>
> What are you trying to achieve...?
Mark Rae [MVP] - 13 Sep 2007 18:23 GMT
> re:
> !> Not 100% reliably - some browsers deliberately do not send this,
> !> and some ISPs deliberately strip it from headers...
>
> Plus, some users don't come from a referring page...
Indeed.

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
> Not 100% reliably - some browsers deliberately do not send this, and some
> ISPs deliberately strip it from headers...
>
> What are you trying to achieve...?
I am making a custom error page, and for debugging purposes i want to
send through email which page the user came from, if i can, to make
debugging easier (with debugging OFF)
On classic asp, i had a custom error page, which emailed me even the
file name of the page that had the problem, and the line in most
cases. I can't seem to do this on asp.net unless i turn on debugging,
which causes performance degradation.
Mark Rae [MVP] - 13 Sep 2007 18:28 GMT
>> Not 100% reliably - some browsers deliberately do not send this, and some
>> ISPs deliberately strip it from headers...
[quoted text clipped - 9 lines]
> cases. I can't seem to do this on asp.net unless i turn on debugging,
> which causes performance degradation.
But that's not the same thing... The "file name of the page that had the
problem" is readily accessible within the Exception object...
What you're asking for (or, at least, what you appear to be asking for) is
the name of the page which sent the user to the page that had the problem...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Seguros Catatumbo - 13 Sep 2007 18:44 GMT
> But that's not the same thing... The "file name of the page that had the
> problem" is readily accessible within the Exception object...
>
> What you're asking for (or, at least, what you appear to be asking for) is
> the name of the page which sent the user to the page that had the problem...
Of course it isn't the same thing, that's a separate issue i am
having.
What i want is to redirect the user to a pretty custom error page
which on the backend emails me the url that the user was on when he
got the error, the file name of the code where the error happened, the
line it ocurred on, etc, but while having debugging off. In classic
asp this is very easy to do:
set objError = Server.getLastError()
numero = objError.AspCode
pagina = objError.File
descripcion = objError.Description
fuente = Server.HTMLEncode(objError.Source)
linea = ObjError.Line
iis = ObjError.ASPDescription
Put that in an email and that's it.
Patrice - 13 Sep 2007 18:33 GMT
So it will be there or not. My personal strategy is to dump all server
variables possibly opting out those I'm not interested in (for example you
can see those added by a proxy and that you wouldn't have been able to
explictely queryetc...)
Classic ASP is not compiled and so providing the line number was much more
easy. I made a quick search once but IMO this is not something that is
really compilcated to overcome. Bascially a good principle is to have short
procedures (and you have the call stack) and once you know what the error
message means is it's quite easy to find out which line could have produced
the error.
--
Patrice
>> Not 100% reliably - some browsers deliberately do not send this, and some
>> ISPs deliberately strip it from headers...
[quoted text clipped - 9 lines]
> cases. I can't seem to do this on asp.net unless i turn on debugging,
> which causes performance degradation.