|
 |
aspx thread: finding the name of the calling Web Page
Message #1 by "Pierre Durand" <pierre@d...> on Wed, 15 May 2002 16:00:40 -0600
|
|
In the page load event I am trying to verify the name of the calling
page. Getting the calling page's URL would be great.
Dows anyone know how best to achieve this?
pierre
Message #2 by "Minh T. Nguyen" <nguyentriminh@y...> on Wed, 15 May 2002 15:11:47 -0700
|
|
Pierre,
It's Request.Url.ToString().
Minh.
-----Original Message-----
From: Pierre Durand [mailto:pierre@d...]
Sent: Wednesday, May 15, 2002 3:01 PM
To: ASP+
Subject: [aspx] finding the name of the calling Web Page
In the page load event I am trying to verify the name of the calling
page. Getting the calling page's URL would be great.
Dows anyone know how best to achieve this?
pierre
Message #3 by "Pierre Durand" <pierre@d...> on Thu, 16 May 2002 08:18:24 -0600
|
|
Thanks Minh for the response,
Request.url.tostring() gives me the page called or the current page when
used in the page load event. (Unless I am doing something wrong?)
What I am looking for is the name of the page where the
response.redirect("ToPage.aspx") came from.
For security reasons, when a page loads, I wish to verify where the
request came from. If the page is not one of the authorized entry point
to the current page we would reject the request....
pierre
-----Original Message-----
From: Minh T. Nguyen [mailto:nguyentriminh@y...]
Sent: Wednesday, May 15, 2002 4:12 PM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Pierre,
It's Request.Url.ToString().
Minh.
-----Original Message-----
From: Pierre Durand [mailto:pierre@d...]
Sent: Wednesday, May 15, 2002 3:01 PM
To: ASP+
Subject: [aspx] finding the name of the calling Web Page
In the page load event I am trying to verify the name of the calling
page. Getting the calling page's URL would be great.
Dows anyone know how best to achieve this?
pierre
Message #4 by "Ray Jezek (TT)" <ray.jezek@t...> on Thu, 16 May 2002 09:42:11 -0500
|
|
You should be able to get HTTP_REFERRER (I think that's what its called)
from the http header.
-----Original Message-----
From: Pierre Durand [mailto:pierre@d...]
Sent: Thursday, May 16, 2002 9:18 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Thanks Minh for the response,
Request.url.tostring() gives me the page called or the current page when
used in the page load event. (Unless I am doing something wrong?)
What I am looking for is the name of the page where the
response.redirect("ToPage.aspx") came from.
For security reasons, when a page loads, I wish to verify where the
request came from. If the page is not one of the authorized entry point
to the current page we would reject the request....
pierre
-----Original Message-----
From: Minh T. Nguyen [mailto:nguyentriminh@y...]
Sent: Wednesday, May 15, 2002 4:12 PM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Pierre,
It's Request.Url.ToString().
Minh.
-----Original Message-----
From: Pierre Durand [mailto:pierre@d...]
Sent: Wednesday, May 15, 2002 3:01 PM
To: ASP+
Subject: [aspx] finding the name of the calling Web Page
In the page load event I am trying to verify the name of the calling
page. Getting the calling page's URL would be great.
Dows anyone know how best to achieve this?
pierre
Message #5 by "Minh T. Nguyen" <nguyentriminh@y...> on Thu, 16 May 2002 08:10:00 -0700
|
|
Pierre,
Oops, I didn't read your post correctly. I thought that that's
what you were looking for. If you want to know where the redirect came
from, use Request.ServerVariables.Get("HTTP_REFERRER"); I belive that's
the syntax. If not, it's something like it. Use VS.NET's IntelliSense to
find out what the correct syntax is.
Later,
Min.h
-----Original Message-----
From: Pierre Durand [mailto:pierre@d...]
Sent: Thursday, May 16, 2002 7:18 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Thanks Minh for the response,
Request.url.tostring() gives me the page called or the current page when
used in the page load event. (Unless I am doing something wrong?)
What I am looking for is the name of the page where the
response.redirect("ToPage.aspx") came from.
For security reasons, when a page loads, I wish to verify where the
request came from. If the page is not one of the authorized entry point
to the current page we would reject the request....
pierre
-----Original Message-----
From: Minh T. Nguyen [mailto:nguyentriminh@y...]
Sent: Wednesday, May 15, 2002 4:12 PM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Pierre,
It's Request.Url.ToString().
Minh.
-----Original Message-----
From: Pierre Durand [mailto:pierre@d...]
Sent: Wednesday, May 15, 2002 3:01 PM
To: ASP+
Subject: [aspx] finding the name of the calling Web Page
In the page load event I am trying to verify the name of the calling
page. Getting the calling page's URL would be great.
Dows anyone know how best to achieve this?
pierre
Message #6 by "Philip Goatly" <philip.goatly@b...> on Thu, 16 May 2002 16:16:58 +0100
|
|
Folks,
try this ib the page load section as shown below:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MyUrl As Uri = Request.UrlReferrer
Response.Write("" & MyUrl.ToString & "<br>")
End Sub
----- Original Message -----
From: "Ray Jezek (TT)" <ray.jezek@t...>
To: "ASP+" <aspx@p...>
Sent: Thursday, May 16, 2002 3:42 PM
Subject: [aspx] RE: finding the name of the calling Web Page
> You should be able to get HTTP_REFERRER (I think that's what its called)
> from the http header.
>
> -----Original Message-----
> From: Pierre Durand [mailto:pierre@d...]
> Sent: Thursday, May 16, 2002 9:18 AM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Thanks Minh for the response,
>
> Request.url.tostring() gives me the page called or the current page when
> used in the page load event. (Unless I am doing something wrong?)
>
> What I am looking for is the name of the page where the
> response.redirect("ToPage.aspx") came from.
>
>
> For security reasons, when a page loads, I wish to verify where the
> request came from. If the page is not one of the authorized entry point
> to the current page we would reject the request....
>
>
> pierre
>
>
>
> -----Original Message-----
> From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> Sent: Wednesday, May 15, 2002 4:12 PM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Pierre,
>
> It's Request.Url.ToString().
>
> Minh.
>
> -----Original Message-----
> From: Pierre Durand [mailto:pierre@d...]
> Sent: Wednesday, May 15, 2002 3:01 PM
> To: ASP+
> Subject: [aspx] finding the name of the calling Web Page
>
>
> In the page load event I am trying to verify the name of the calling
> page. Getting the calling page's URL would be great.
> Dows anyone know how best to achieve this?
>
> pierre
>
>
>
>
>
>
>
>
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
Message #7 by "Pierre Durand" <pierre@d...> on Thu, 16 May 2002 16:00:57 -0600
|
|
No luck
So far all these attempts result in the UrlReferrer set to Nothing
MyUrl is set to nothing when one aspx page calls another using
Response.Redirect("NewAddressDetails.aspx?ParticipantID=" &
intParticipantID)
In the page load section of NewAddressDetails.aspx I run the following
and MyUrl is set to nothing
Dim MyUrl As Uri = Request.UrlReferrer
Response.Write("" & MyUrl.ToString & "<br>")
Pierre
-----Original Message-----
From: Philip Goatly [mailto:philip.goatly@b...]
Sent: Thursday, May 16, 2002 9:17 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Folks,
try this ib the page load section as shown below:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MyUrl As Uri = Request.UrlReferrer
Response.Write("" & MyUrl.ToString & "<br>")
End Sub
----- Original Message -----
From: "Ray Jezek (TT)" <ray.jezek@t...>
To: "ASP+" <aspx@p...>
Sent: Thursday, May 16, 2002 3:42 PM
Subject: [aspx] RE: finding the name of the calling Web Page
> You should be able to get HTTP_REFERRER (I think that's what its
called)
> from the http header.
>
> -----Original Message-----
> From: Pierre Durand [mailto:pierre@d...]
> Sent: Thursday, May 16, 2002 9:18 AM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Thanks Minh for the response,
>
> Request.url.tostring() gives me the page called or the current page
when
> used in the page load event. (Unless I am doing something wrong?)
>
> What I am looking for is the name of the page where the
> response.redirect("ToPage.aspx") came from.
>
>
> For security reasons, when a page loads, I wish to verify where the
> request came from. If the page is not one of the authorized entry
point
> to the current page we would reject the request....
>
>
> pierre
>
>
>
> -----Original Message-----
> From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> Sent: Wednesday, May 15, 2002 4:12 PM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Pierre,
>
> It's Request.Url.ToString().
>
> Minh.
>
> -----Original Message-----
> From: Pierre Durand [mailto:pierre@d...]
> Sent: Wednesday, May 15, 2002 3:01 PM
> To: ASP+
> Subject: [aspx] finding the name of the calling Web Page
>
>
> In the page load event I am trying to verify the name of the calling
> page. Getting the calling page's URL would be great.
> Dows anyone know how best to achieve this?
>
> pierre
>
>
>
>
>
>
>
>
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
Message #8 by "Minh T. Nguyen" <nguyentriminh@y...> on Thu, 16 May 2002 16:15:55 -0700
|
|
Pierre,
Use Request.ServerVariables("HTTP_REFERER"), this works for me.
For both regular links in the <a href=".."> format as well as using
Response.Redirect.
Minh.
-----Original Message-----
From: Pierre Durand [mailto:pierre@d...]
Sent: Thursday, May 16, 2002 3:01 PM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
No luck
So far all these attempts result in the UrlReferrer set to Nothing
MyUrl is set to nothing when one aspx page calls another using
Response.Redirect("NewAddressDetails.aspx?ParticipantID=" &
intParticipantID)
In the page load section of NewAddressDetails.aspx I run the following
and MyUrl is set to nothing
Dim MyUrl As Uri = Request.UrlReferrer
Response.Write("" & MyUrl.ToString & "<br>")
Pierre
-----Original Message-----
From: Philip Goatly [mailto:philip.goatly@b...]
Sent: Thursday, May 16, 2002 9:17 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Folks,
try this ib the page load section as shown below:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MyUrl As Uri = Request.UrlReferrer
Response.Write("" & MyUrl.ToString & "<br>")
End Sub
----- Original Message -----
From: "Ray Jezek (TT)" <ray.jezek@t...>
To: "ASP+" <aspx@p...>
Sent: Thursday, May 16, 2002 3:42 PM
Subject: [aspx] RE: finding the name of the calling Web Page
> You should be able to get HTTP_REFERRER (I think that's what its
called)
> from the http header.
>
> -----Original Message-----
> From: Pierre Durand [mailto:pierre@d...]
> Sent: Thursday, May 16, 2002 9:18 AM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Thanks Minh for the response,
>
> Request.url.tostring() gives me the page called or the current page
when
> used in the page load event. (Unless I am doing something wrong?)
>
> What I am looking for is the name of the page where the
> response.redirect("ToPage.aspx") came from.
>
>
> For security reasons, when a page loads, I wish to verify where the
> request came from. If the page is not one of the authorized entry
point
> to the current page we would reject the request....
>
>
> pierre
>
>
>
> -----Original Message-----
> From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> Sent: Wednesday, May 15, 2002 4:12 PM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Pierre,
>
> It's Request.Url.ToString().
>
> Minh.
>
> -----Original Message-----
> From: Pierre Durand [mailto:pierre@d...]
> Sent: Wednesday, May 15, 2002 3:01 PM
> To: ASP+
> Subject: [aspx] finding the name of the calling Web Page
>
>
> In the page load event I am trying to verify the name of the calling
> page. Getting the calling page's URL would be great.
> Dows anyone know how best to achieve this?
>
> pierre
>
>
>
>
>
>
>
>
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
Message #9 by "Dave Rezoski" <daverezoski@h...> on Fri, 17 May 2002 05:48:31 +0000
|
|
try
me.request.servervariables.get("HTTP_REFERRER")
----Original Message Follows----
From: "Pierre Durand" <pierre@d...>
Reply-To: "ASP+" <aspx@p...>
To: "ASP+" <aspx@p...>
Subject: [aspx] RE: finding the name of the calling Web Page
Date: Thu, 16 May 2002 16:00:57 -0600
No luck
So far all these attempts result in the UrlReferrer set to Nothing
MyUrl is set to nothing when one aspx page calls another using
Response.Redirect("NewAddressDetails.aspx?ParticipantID=" &
intParticipantID)
In the page load section of NewAddressDetails.aspx I run the following
and MyUrl is set to nothing
Dim MyUrl As Uri = Request.UrlReferrer
Response.Write("" & MyUrl.ToString & "<br>")
Pierre
-----Original Message-----
From: Philip Goatly [mailto:philip.goatly@b...]
Sent: Thursday, May 16, 2002 9:17 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Folks,
try this ib the page load section as shown below:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim MyUrl As Uri = Request.UrlReferrer
Response.Write("" & MyUrl.ToString & "<br>")
End Sub
----- Original Message -----
From: "Ray Jezek (TT)" <ray.jezek@t...>
To: "ASP+" <aspx@p...>
Sent: Thursday, May 16, 2002 3:42 PM
Subject: [aspx] RE: finding the name of the calling Web Page
> You should be able to get HTTP_REFERRER (I think that's what its
called)
> from the http header.
>
> -----Original Message-----
> From: Pierre Durand [mailto:pierre@d...]
> Sent: Thursday, May 16, 2002 9:18 AM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Thanks Minh for the response,
>
> Request.url.tostring() gives me the page called or the current page
when
> used in the page load event. (Unless I am doing something wrong?)
>
> What I am looking for is the name of the page where the
> response.redirect("ToPage.aspx") came from.
>
>
> For security reasons, when a page loads, I wish to verify where the
> request came from. If the page is not one of the authorized entry
point
> to the current page we would reject the request....
>
>
> pierre
>
>
>
> -----Original Message-----
> From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> Sent: Wednesday, May 15, 2002 4:12 PM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Pierre,
>
> It's Request.Url.ToString().
>
> Minh.
>
> -----Original Message-----
> From: Pierre Durand [mailto:pierre@d...]
> Sent: Wednesday, May 15, 2002 3:01 PM
> To: ASP+
> Subject: [aspx] finding the name of the calling Web Page
>
>
> In the page load event I am trying to verify the name of the calling
> page. Getting the calling page's URL would be great.
> Dows anyone know how best to achieve this?
>
> pierre
>
>
>
>
>
>
>
>
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
Message #10 by "Philip Goatly" <philip.goatly@b...> on Fri, 17 May 2002 09:14:16 +0100
|
|
I don't understand then since this works OK for me.
I just cut and pasted this from my application !!!!
Cheers, Phil
----- Original Message -----
From: "Pierre Durand" <pierre@d...>
To: "ASP+" <aspx@p...>
Sent: Thursday, May 16, 2002 11:00 PM
Subject: [aspx] RE: finding the name of the calling Web Page
> No luck
>
> So far all these attempts result in the UrlReferrer set to Nothing
>
> MyUrl is set to nothing when one aspx page calls another using
> Response.Redirect("NewAddressDetails.aspx?ParticipantID=" &
> intParticipantID)
>
> In the page load section of NewAddressDetails.aspx I run the following
> and MyUrl is set to nothing
>
> Dim MyUrl As Uri = Request.UrlReferrer
> Response.Write("" & MyUrl.ToString & "<br>")
>
> Pierre
>
> -----Original Message-----
> From: Philip Goatly [mailto:philip.goatly@b...]
> Sent: Thursday, May 16, 2002 9:17 AM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Folks,
>
> try this ib the page load section as shown below:
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> 'Put user code to initialize the page here
>
> Dim MyUrl As Uri = Request.UrlReferrer
>
> Response.Write("" & MyUrl.ToString & "<br>")
>
>
> End Sub
>
> ----- Original Message -----
> From: "Ray Jezek (TT)" <ray.jezek@t...>
> To: "ASP+" <aspx@p...>
> Sent: Thursday, May 16, 2002 3:42 PM
> Subject: [aspx] RE: finding the name of the calling Web Page
>
>
> > You should be able to get HTTP_REFERRER (I think that's what its
> called)
> > from the http header.
> >
> > -----Original Message-----
> > From: Pierre Durand [mailto:pierre@d...]
> > Sent: Thursday, May 16, 2002 9:18 AM
> > To: ASP+
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> > Thanks Minh for the response,
> >
> > Request.url.tostring() gives me the page called or the current page
> when
> > used in the page load event. (Unless I am doing something wrong?)
> >
> > What I am looking for is the name of the page where the
> > response.redirect("ToPage.aspx") came from.
> >
> >
> > For security reasons, when a page loads, I wish to verify where the
> > request came from. If the page is not one of the authorized entry
> point
> > to the current page we would reject the request....
> >
> >
> > pierre
> >
> >
> >
> > -----Original Message-----
> > From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> > Sent: Wednesday, May 15, 2002 4:12 PM
> > To: ASP+
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> > Pierre,
> >
> > It's Request.Url.ToString().
> >
> > Minh.
> >
> > -----Original Message-----
> > From: Pierre Durand [mailto:pierre@d...]
> > Sent: Wednesday, May 15, 2002 3:01 PM
> > To: ASP+
> > Subject: [aspx] finding the name of the calling Web Page
> >
> >
> > In the page load event I am trying to verify the name of the calling
> > page. Getting the calling page's URL would be great.
> > Dows anyone know how best to achieve this?
> >
> > pierre
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> _____________________________________________________________________
> This message has been checked for all known viruses by the
> MessageLabs Virus Scanning Service.
>
>
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
Message #11 by "Philip Goatly" <philip.goatly@b...> on Fri, 17 May 2002 09:33:26 +0100
|
|
Folks,
I do note however that the following:
s = Request.ServerVariables("HTTP_REFERER")
Response.Write(s & "<br>")
Returns what is needed i.e. the refering page no matter in which routine it
is accessed on the page, so I guess I will use this in future .
Question:
But what if the page is accessed from another server ??? I guess that it
will not work, since serverVariables refer to the current server ?
Cheers, Phil
----- Original Message -----
From: "Philip Goatly" <philip.goatly@b...>
To: "ASP+" <aspx@p...>
Sent: Friday, May 17, 2002 9:14 AM
Subject: [aspx] RE: finding the name of the calling Web Page
> I don't understand then since this works OK for me.
>
> I just cut and pasted this from my application !!!!
>
> Cheers, Phil
> ----- Original Message -----
> From: "Pierre Durand" <pierre@d...>
> To: "ASP+" <aspx@p...>
> Sent: Thursday, May 16, 2002 11:00 PM
> Subject: [aspx] RE: finding the name of the calling Web Page
>
>
> > No luck
> >
> > So far all these attempts result in the UrlReferrer set to Nothing
> >
> > MyUrl is set to nothing when one aspx page calls another using
> > Response.Redirect("NewAddressDetails.aspx?ParticipantID=" &
> > intParticipantID)
> >
> > In the page load section of NewAddressDetails.aspx I run the following
> > and MyUrl is set to nothing
> >
> > Dim MyUrl As Uri = Request.UrlReferrer
> > Response.Write("" & MyUrl.ToString & "<br>")
> >
> > Pierre
> >
> > -----Original Message-----
> > From: Philip Goatly [mailto:philip.goatly@b...]
> > Sent: Thursday, May 16, 2002 9:17 AM
> > To: ASP+
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> > Folks,
> >
> > try this ib the page load section as shown below:
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >
> > 'Put user code to initialize the page here
> >
> > Dim MyUrl As Uri = Request.UrlReferrer
> >
> > Response.Write("" & MyUrl.ToString & "<br>")
> >
> >
> > End Sub
> >
> > ----- Original Message -----
> > From: "Ray Jezek (TT)" <ray.jezek@t...>
> > To: "ASP+" <aspx@p...>
> > Sent: Thursday, May 16, 2002 3:42 PM
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> >
> > > You should be able to get HTTP_REFERRER (I think that's what its
> > called)
> > > from the http header.
> > >
> > > -----Original Message-----
> > > From: Pierre Durand [mailto:pierre@d...]
> > > Sent: Thursday, May 16, 2002 9:18 AM
> > > To: ASP+
> > > Subject: [aspx] RE: finding the name of the calling Web Page
> > >
> > > Thanks Minh for the response,
> > >
> > > Request.url.tostring() gives me the page called or the current page
> > when
> > > used in the page load event. (Unless I am doing something wrong?)
> > >
> > > What I am looking for is the name of the page where the
> > > response.redirect("ToPage.aspx") came from.
> > >
> > >
> > > For security reasons, when a page loads, I wish to verify where the
> > > request came from. If the page is not one of the authorized entry
> > point
> > > to the current page we would reject the request....
> > >
> > >
> > > pierre
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> > > Sent: Wednesday, May 15, 2002 4:12 PM
> > > To: ASP+
> > > Subject: [aspx] RE: finding the name of the calling Web Page
> > >
> > > Pierre,
> > >
> > > It's Request.Url.ToString().
> > >
> > > Minh.
> > >
> > > -----Original Message-----
> > > From: Pierre Durand [mailto:pierre@d...]
> > > Sent: Wednesday, May 15, 2002 3:01 PM
> > > To: ASP+
> > > Subject: [aspx] finding the name of the calling Web Page
> > >
> > >
> > > In the page load event I am trying to verify the name of the calling
> > > page. Getting the calling page's URL would be great.
> > > Dows anyone know how best to achieve this?
> > >
> > > pierre
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > _____________________________________________________________________
> > This message has been checked for all known viruses by the
> > MessageLabs Virus Scanning Service.
> >
> >
> >
> >
>
>
> _____________________________________________________________________
> This message has been checked for all known viruses by the
> MessageLabs Virus Scanning Service.
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
Message #12 by "Pierre Durand" <pierre@d...> on Fri, 17 May 2002 10:01:21 -0600
|
|
I will investigate our setup and environment, since there must be some
problems.
Once I find the answers I will report back.
Thanks everyone for the support...
pierre
-----Original Message-----
From: Philip Goatly [mailto:philip.goatly@b...]
Sent: Friday, May 17, 2002 2:14 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
I don't understand then since this works OK for me.
I just cut and pasted this from my application !!!!
Cheers, Phil
----- Original Message -----
From: "Pierre Durand" <pierre@d...>
To: "ASP+" <aspx@p...>
Sent: Thursday, May 16, 2002 11:00 PM
Subject: [aspx] RE: finding the name of the calling Web Page
> No luck
>
> So far all these attempts result in the UrlReferrer set to Nothing
>
> MyUrl is set to nothing when one aspx page calls another using
> Response.Redirect("NewAddressDetails.aspx?ParticipantID=" &
> intParticipantID)
>
> In the page load section of NewAddressDetails.aspx I run the following
> and MyUrl is set to nothing
>
> Dim MyUrl As Uri = Request.UrlReferrer
> Response.Write("" & MyUrl.ToString & "<br>")
>
> Pierre
>
> -----Original Message-----
> From: Philip Goatly [mailto:philip.goatly@b...]
> Sent: Thursday, May 16, 2002 9:17 AM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Folks,
>
> try this ib the page load section as shown below:
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> 'Put user code to initialize the page here
>
> Dim MyUrl As Uri = Request.UrlReferrer
>
> Response.Write("" & MyUrl.ToString & "<br>")
>
>
> End Sub
>
> ----- Original Message -----
> From: "Ray Jezek (TT)" <ray.jezek@t...>
> To: "ASP+" <aspx@p...>
> Sent: Thursday, May 16, 2002 3:42 PM
> Subject: [aspx] RE: finding the name of the calling Web Page
>
>
> > You should be able to get HTTP_REFERRER (I think that's what its
> called)
> > from the http header.
> >
> > -----Original Message-----
> > From: Pierre Durand [mailto:pierre@d...]
> > Sent: Thursday, May 16, 2002 9:18 AM
> > To: ASP+
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> > Thanks Minh for the response,
> >
> > Request.url.tostring() gives me the page called or the current page
> when
> > used in the page load event. (Unless I am doing something wrong?)
> >
> > What I am looking for is the name of the page where the
> > response.redirect("ToPage.aspx") came from.
> >
> >
> > For security reasons, when a page loads, I wish to verify where the
> > request came from. If the page is not one of the authorized entry
> point
> > to the current page we would reject the request....
> >
> >
> > pierre
> >
> >
> >
> > -----Original Message-----
> > From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> > Sent: Wednesday, May 15, 2002 4:12 PM
> > To: ASP+
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> > Pierre,
> >
> > It's Request.Url.ToString().
> >
> > Minh.
> >
> > -----Original Message-----
> > From: Pierre Durand [mailto:pierre@d...]
> > Sent: Wednesday, May 15, 2002 3:01 PM
> > To: ASP+
> > Subject: [aspx] finding the name of the calling Web Page
> >
> >
> > In the page load event I am trying to verify the name of the calling
> > page. Getting the calling page's URL would be great.
> > Dows anyone know how best to achieve this?
> >
> > pierre
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> _____________________________________________________________________
> This message has been checked for all known viruses by the
> MessageLabs Virus Scanning Service.
>
>
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
Message #13 by "Ray Jezek (TT)" <ray.jezek@t...> on Fri, 17 May 2002 12:36:15 -0500
|
|
A couple comments about this thread:
1. HTTP_REFERER is sent in the header of the request and therefore will
work no matter where the request came from. This is not something that your
local server generates per se. This brings me to my next point.
2. Using HTTP_REFERER in a security model is not a good idea seeing that it
can be spoofed by an 8 year old. An HTTP header is created by your client
and therefore can be manipulated by any user. Try this for example:
on your local box create 2 files in the wwwroot: spoofme.htm and spoof.asp
with the following contents (im using just plain ole asp to illustrate my
point)
spoofme.htm:
<a href="spoof.asp">click me</a>
spoof.asp:
<%
Response.Write("You came from: " & Request.ServerVariables("HTTP_REFERER"))
%>
Now open IE and go to http://localhost/spoofme.htm and click on the link and
you will see what is supposed to happen. This is what normally happens when
a client follows a link. Now try this; open a command prompt and type in
the following:
telnet localhost 80 (press return)
GET /spoof.asp HTTP/1.0 (press return)
Referer: http://www.spoofedya.com (press return)
(press return again)
The results on the screen will read that you came from the domain
spoofedya.com which totally circumvents the security structure you are
trying to create.
Rather than use an HTTP header for security I would consider something
completely server-side such as a session variable that is set and read from
to confirm that a user came to a page in the right order or from the right
location.
Hope this helps.
jez
-----Original Message-----
From: Pierre Durand [mailto:pierre@d...]
Sent: Friday, May 17, 2002 11:01 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
I will investigate our setup and environment, since there must be some
problems.
Once I find the answers I will report back.
Thanks everyone for the support...
pierre
-----Original Message-----
From: Philip Goatly [mailto:philip.goatly@b...]
Sent: Friday, May 17, 2002 2:14 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
I don't understand then since this works OK for me.
I just cut and pasted this from my application !!!!
Cheers, Phil
----- Original Message -----
From: "Pierre Durand" <pierre@d...>
To: "ASP+" <aspx@p...>
Sent: Thursday, May 16, 2002 11:00 PM
Subject: [aspx] RE: finding the name of the calling Web Page
> No luck
>
> So far all these attempts result in the UrlReferrer set to Nothing
>
> MyUrl is set to nothing when one aspx page calls another using
> Response.Redirect("NewAddressDetails.aspx?ParticipantID=" &
> intParticipantID)
>
> In the page load section of NewAddressDetails.aspx I run the following
> and MyUrl is set to nothing
>
> Dim MyUrl As Uri = Request.UrlReferrer
> Response.Write("" & MyUrl.ToString & "<br>")
>
> Pierre
>
> -----Original Message-----
> From: Philip Goatly [mailto:philip.goatly@b...]
> Sent: Thursday, May 16, 2002 9:17 AM
> To: ASP+
> Subject: [aspx] RE: finding the name of the calling Web Page
>
> Folks,
>
> try this ib the page load section as shown below:
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> 'Put user code to initialize the page here
>
> Dim MyUrl As Uri = Request.UrlReferrer
>
> Response.Write("" & MyUrl.ToString & "<br>")
>
>
> End Sub
>
> ----- Original Message -----
> From: "Ray Jezek (TT)" <ray.jezek@t...>
> To: "ASP+" <aspx@p...>
> Sent: Thursday, May 16, 2002 3:42 PM
> Subject: [aspx] RE: finding the name of the calling Web Page
>
>
> > You should be able to get HTTP_REFERRER (I think that's what its
> called)
> > from the http header.
> >
> > -----Original Message-----
> > From: Pierre Durand [mailto:pierre@d...]
> > Sent: Thursday, May 16, 2002 9:18 AM
> > To: ASP+
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> > Thanks Minh for the response,
> >
> > Request.url.tostring() gives me the page called or the current page
> when
> > used in the page load event. (Unless I am doing something wrong?)
> >
> > What I am looking for is the name of the page where the
> > response.redirect("ToPage.aspx") came from.
> >
> >
> > For security reasons, when a page loads, I wish to verify where the
> > request came from. If the page is not one of the authorized entry
> point
> > to the current page we would reject the request....
> >
> >
> > pierre
> >
> >
> >
> > -----Original Message-----
> > From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> > Sent: Wednesday, May 15, 2002 4:12 PM
> > To: ASP+
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> > Pierre,
> >
> > It's Request.Url.ToString().
> >
> > Minh.
> >
> > -----Original Message-----
> > From: Pierre Durand [mailto:pierre@d...]
> > Sent: Wednesday, May 15, 2002 3:01 PM
> > To: ASP+
> > Subject: [aspx] finding the name of the calling Web Page
> >
> >
> > In the page load event I am trying to verify the name of the calling
> > page. Getting the calling page's URL would be great.
> > Dows anyone know how best to achieve this?
> >
> > pierre
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> _____________________________________________________________________
> This message has been checked for all known viruses by the
> MessageLabs Virus Scanning Service.
>
>
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
Message #14 by "Minh T. Nguyen" <nguyentriminh@y...> on Fri, 17 May 2002 10:53:20 -0700
|
|
Phil,
No. ServerVariables("HTTP_REFERRER") will always work,
regardless of where you are coming from. In fact, I use that a lot to
find out how people came to my website (google? yahoo? Some private
email in their outlook?).
Minh.
-----Original Message-----
From: Philip Goatly [mailto:philip.goatly@b...]
Sent: Friday, May 17, 2002 1:33 AM
To: ASP+
Subject: [aspx] RE: finding the name of the calling Web Page
Folks,
I do note however that the following:
s = Request.ServerVariables("HTTP_REFERER")
Response.Write(s & "<br>")
Returns what is needed i.e. the refering page no matter in which
routine it
is accessed on the page, so I guess I will use this in future .
Question:
But what if the page is accessed from another server ??? I guess that it
will not work, since serverVariables refer to the current server ?
Cheers, Phil
----- Original Message -----
From: "Philip Goatly" <philip.goatly@b...>
To: "ASP+" <aspx@p...>
Sent: Friday, May 17, 2002 9:14 AM
Subject: [aspx] RE: finding the name of the calling Web Page
> I don't understand then since this works OK for me.
>
> I just cut and pasted this from my application !!!!
>
> Cheers, Phil
> ----- Original Message -----
> From: "Pierre Durand" <pierre@d...>
> To: "ASP+" <aspx@p...>
> Sent: Thursday, May 16, 2002 11:00 PM
> Subject: [aspx] RE: finding the name of the calling Web Page
>
>
> > No luck
> >
> > So far all these attempts result in the UrlReferrer set to Nothing
> >
> > MyUrl is set to nothing when one aspx page calls another using
> > Response.Redirect("NewAddressDetails.aspx?ParticipantID=" &
> > intParticipantID)
> >
> > In the page load section of NewAddressDetails.aspx I run the
following
> > and MyUrl is set to nothing
> >
> > Dim MyUrl As Uri = Request.UrlReferrer
> > Response.Write("" & MyUrl.ToString & "<br>")
> >
> > Pierre
> >
> > -----Original Message-----
> > From: Philip Goatly [mailto:philip.goatly@b...]
> > Sent: Thursday, May 16, 2002 9:17 AM
> > To: ASP+
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> > Folks,
> >
> > try this ib the page load section as shown below:
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >
> > 'Put user code to initialize the page here
> >
> > Dim MyUrl As Uri = Request.UrlReferrer
> >
> > Response.Write("" & MyUrl.ToString & "<br>")
> >
> >
> > End Sub
> >
> > ----- Original Message -----
> > From: "Ray Jezek (TT)" <ray.jezek@t...>
> > To: "ASP+" <aspx@p...>
> > Sent: Thursday, May 16, 2002 3:42 PM
> > Subject: [aspx] RE: finding the name of the calling Web Page
> >
> >
> > > You should be able to get HTTP_REFERRER (I think that's what its
> > called)
> > > from the http header.
> > >
> > > -----Original Message-----
> > > From: Pierre Durand [mailto:pierre@d...]
> > > Sent: Thursday, May 16, 2002 9:18 AM
> > > To: ASP+
> > > Subject: [aspx] RE: finding the name of the calling Web Page
> > >
> > > Thanks Minh for the response,
> > >
> > > Request.url.tostring() gives me the page called or the current
page
> > when
> > > used in the page load event. (Unless I am doing something wrong?)
> > >
> > > What I am looking for is the name of the page where the
> > > response.redirect("ToPage.aspx") came from.
> > >
> > >
> > > For security reasons, when a page loads, I wish to verify where
the
> > > request came from. If the page is not one of the authorized entry
> > point
> > > to the current page we would reject the request....
> > >
> > >
> > > pierre
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Minh T. Nguyen [mailto:nguyentriminh@y...]
> > > Sent: Wednesday, May 15, 2002 4:12 PM
> > > To: ASP+
> > > Subject: [aspx] RE: finding the name of the calling Web Page
> > >
> > > Pierre,
> > >
> > > It's Request.Url.ToString().
> > >
> > > Minh.
> > >
> > > -----Original Message-----
> > > From: Pierre Durand [mailto:pierre@d...]
> > > Sent: Wednesday, May 15, 2002 3:01 PM
> > > To: ASP+
> > > Subject: [aspx] finding the name of the calling Web Page
> > >
> > >
> > > In the page load event I am trying to verify the name of the
calling
> > > page. Getting the calling page's URL would be great.
> > > Dows anyone know how best to achieve this?
> > >
> > > pierre
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
_____________________________________________________________________
> > This message has been checked for all known viruses by the
> > MessageLabs Virus Scanning Service.
> >
> >
> >
> >
>
>
> _____________________________________________________________________
> This message has been checked for all known viruses by the
> MessageLabs Virus Scanning Service.
>
>
_____________________________________________________________________
This message has been checked for all known viruses by the
MessageLabs Virus Scanning Service.
|
|
 |