From: Jeff on
Hi

asp.net 3.5

I see in the statics for mys ite that about 50% of the request are 404 not
found. so I'm setting up a NoSuchPage.aspx which I want the user to be
redirected to when such error occur.

<customErrors mode="RemoteOnly" defaultRedirect="AppErrors.aspx">
<error statusCode="404" redirect="NoSuchPage.aspx"/>
<error statusCode="403" redirect="NoAccessAllowed.aspx"/>
</customErrors>

In the NoSuchPage I want to write to the database which page the user
requested.
I'm unsure about how to get info about that Page. I've tryed
Uri.AbsolutePath, but that only gave NoSuchPage.aspx... And
Request.UrlReferrer gives compile error
what you suggest?


From: Jeff on
Okay, I've solved it. I use
Request.RawUrl.ToString()



"Jeff" <it_consultant1(a)hotmail.com.NOSPAM> wrote in message
news:%23zNlA9fuKHA.796(a)TK2MSFTNGP05.phx.gbl...
> Hi
>
> asp.net 3.5
>
> I see in the statics for mys ite that about 50% of the request are 404 not
> found. so I'm setting up a NoSuchPage.aspx which I want the user to be
> redirected to when such error occur.
>
> <customErrors mode="RemoteOnly" defaultRedirect="AppErrors.aspx">
> <error statusCode="404" redirect="NoSuchPage.aspx"/>
> <error statusCode="403" redirect="NoAccessAllowed.aspx"/>
> </customErrors>
>
> In the NoSuchPage I want to write to the database which page the user
> requested.
> I'm unsure about how to get info about that Page. I've tryed
> Uri.AbsolutePath, but that only gave NoSuchPage.aspx... And
> Request.UrlReferrer gives compile error
> what you suggest?
>
>


From: Alexey Smirnov on
On Mar 2, 12:55 pm, "Jeff" <it_consulta...(a)hotmail.com.NOSPAM> wrote:
> Hi
>
> asp.net 3.5
>
> I see in the statics for mys ite that about 50% of the request are 404 not
> found. so I'm setting up a NoSuchPage.aspx which I want the user to be
> redirected to when such error occur.
>
> <customErrors mode="RemoteOnly" defaultRedirect="AppErrors.aspx">
>    <error statusCode="404" redirect="NoSuchPage.aspx"/>
>    <error statusCode="403" redirect="NoAccessAllowed.aspx"/>
> </customErrors>
>
> In the NoSuchPage I want to write to the database which page the user
> requested.
> I'm unsure about how to get info about that Page. I've tryed
> Uri.AbsolutePath, but that only gave NoSuchPage.aspx... And
> Request.UrlReferrer gives compile error
> what you suggest?

HttpRequest.UrlReferrer Property gets information about the URL of the
client's previous request that linked to the current URL. You need to
check if it is not null (UrlReferrer != null) because client can strip
that header