The problem of Request.UrlReferrer

A

ad

I have tree web page A.ASPX, B.ASPX and CheckPW.aspx

There is a button in A.ASPX, the click of that button is redirect to B.ASPX
..
I write a Page_Load event in b.aspx, if the Session["PasswordChecked"] is
null then redirect to CheckPW.aspx to check the password.

There is a text box and button in CheckPW.aspx, I write an Click event in
CheckPW.aspx:
If password is correct
{
redirect to (Request.UrlReferrer)
}

I thought the CheckPW.aspx will redirect to B.ASPX, but it redirect to
A.ASPX.

What's the problem?
 
P

Patrice

Actually I even thought first it should just display repeateadly checkPW as
on postback the referer should be actually the CheckPW page herself.
How do you redirect (Response.redirect ?). It would quite easy to always
dump the referer to see how it behaves.

As a side note, some browser may not provide the referer (AFAIK this is
defined as an optional information)...

My personal preference (in ASP) was to explicitely store the context in
which I am so that I can return there regardless of the control flow once
authenticated. As a side note this is done automatically by the ASP.NET
authentication module (it keeps a "ReturnUrl" variable)...
 
A

ad

Thanks,
I forget to metion that I record the Request.UrlReferrer in the PageLoad
event
HiddenField.value=Request.UrlReferrer;
and use Response.redirect (HiddenField.value) when PassWord checked.
But it redirect to A.aspx not to B.aspx.

What about ReturnUrl variable? and what is your method?
Could you tell me more detail?







Patrice said:
Actually I even thought first it should just display repeateadly checkPW
as
on postback the referer should be actually the CheckPW page herself.
How do you redirect (Response.redirect ?). It would quite easy to always
dump the referer to see how it behaves.

As a side note, some browser may not provide the referer (AFAIK this is
defined as an optional information)...

My personal preference (in ASP) was to explicitely store the context in
which I am so that I can return there regardless of the control flow once
authenticated. As a side note this is done automatically by the ASP.NET
authentication module (it keeps a "ReturnUrl" variable)...

--
Patrice

ad said:
I have tree web page A.ASPX, B.ASPX and CheckPW.aspx

There is a button in A.ASPX, the click of that button is redirect to B.ASPX
.
I write a Page_Load event in b.aspx, if the Session["PasswordChecked"] is
null then redirect to CheckPW.aspx to check the password.

There is a text box and button in CheckPW.aspx, I write an Click event in
CheckPW.aspx:
If password is correct
{
redirect to (Request.UrlReferrer)
}

I thought the CheckPW.aspx will redirect to B.ASPX, but it redirect to
A.ASPX.

What's the problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top