473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Response.Redirect not changing URL?

In file FIRST.ASP, I've got
<%
Response.Redirect "SECOND.ASP"
%>

The redirect is happening, and I'm seeing the content from SECOND.ASP in the browser,
but the URL in the browser is still saying FIRST.ASP.

Does anyone know why this is happening and how I can insure the browser displays
SECOND.ASP? I'm using IE6.

THANKS,

-Bill.
Mar 21 '06 #1
10 13335
Bill wrote:
In file FIRST.ASP, I've got
<%
Response.Redirect "SECOND.ASP"
%>

The redirect is happening, and I'm seeing the content from SECOND.ASP
in the browser, but the URL in the browser is still saying FIRST.ASP.

Does anyone know why this is happening
That's just the way it works. A Redirect does not change the name of the
page that was requested ...
and how I can insure the browser displays SECOND.ASP? .
The browser has to request SECOND.ASP in order for that to appear in the
address bar. Server-side code cannot alter this.
What you can do is redirect to an intermediate page that uses client-side
code to navigate to SECOND.ASP
I'm using IE6

Irrelevant.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 21 '06 #2

"Bob Barrows [MVP]" wrote...
Bill wrote:
In file FIRST.ASP, I've got
<%
Response.Redirect "SECOND.ASP"
%>

The redirect is happening, and I'm seeing the content from SECOND.ASP
in the browser, but the URL in the browser is still saying FIRST.ASP.

Does anyone know why this is happening
That's just the way it works. A Redirect does not change the name of the
page that was requested ...


Are confusing this with Server.Transfer? That does not change the URL of the browser
because it redirects the SERVER to the new page.

Response.Redirect, according to Microsoft, "redirects a CLIENT to a new URL". In the
past, it has always changed the URL for me. This is why Response.Redirect can be used to
redirect to another server (Server.Transfer cannot).
http://msdn.microsoft.com/library/en...irecttopic.asp
http://msdn.microsoft.com/library/en...7f38f37ab3.asp

and how I can insure the browser displays SECOND.ASP? .


The browser has to request SECOND.ASP in order for that to appear in the
address bar. Server-side code cannot alter this.


Response.Redirect does this:
http://msdn.microsoft.com/library/en...7f38f37ab3.asp
"this method does send other HTTP headers set by this page indicated by the original URL
to the client."

That's why Response.Redirect is less efficient than Server.Transfer, because ST doesn't
communicate with the client, RD does.

What you can do is redirect to an intermediate page that uses client-side
code to navigate to SECOND.ASP
I'm using IE6

Irrelevant.


The browser URL changes in Firefox.



Mar 21 '06 #3
Bill wrote on 21 mrt 2006 in microsoft.public.inetserver.asp.general:
That's just the way it works. A Redirect does not change the name of
the page that was requested ...
Are confusing this with Server.Transfer? That does not change the URL
of the browser because it redirects the SERVER to the new page.

Response.Redirect, according to Microsoft, "redirects a CLIENT to a
new URL".


You are so right.
That's why Response.Redirect is less efficient than Server.Transfer,
because ST doesn't communicate with the client, RD does.


The nice thing about Server.Transfer is,
that you don't need no client anymore.
[For the second file's excution, that is]

Clients are a nuisance, both they and their diverse browsers heavily
interfere with perfect web scripting.

I can imagine a NG especially for unserved serverside scripting.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 21 '06 #4
Bill wrote:
Are confusing this with Server.Transfer? That does not change the URL
of the browser because it redirects the SERVER to the new page.

Yes I goofed.

I just ran some tests on my server, and the url changes as it is supposed to
(using IE6)
There aren't any frames involved are there?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 21 '06 #5
I've seen in the past that if I'm on page1.asp, and I had a server-side
error before the redirect, corrected the error, refreshed, IE would display
the old URL even after the redirect. After closing the browser and going
through the page again, it would redirect and show in the address bar as
expected.

Ray at home

"Bill" <Bi*****@yahoo.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...
In file FIRST.ASP, I've got
<%
Response.Redirect "SECOND.ASP"
%>

The redirect is happening, and I'm seeing the content from SECOND.ASP in
the browser,
but the URL in the browser is still saying FIRST.ASP.

Does anyone know why this is happening and how I can insure the browser
displays
SECOND.ASP? I'm using IE6.

THANKS,

-Bill.

Mar 22 '06 #6
Ray Costanzo [MVP] wrote on 22 mrt 2006 in
microsoft.public.inetserver.asp.general:
I've seen in the past that if I'm on page1.asp, and I had a
server-side error before the redirect, corrected the error, refreshed,
IE would display the old URL even after the redirect. After closing
the browser and going through the page again, it would redirect and
show in the address bar as expected.


I think MS got that fixed, as I didn't see that the last months.
[or, doubtfull, my programming has become better]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 22 '06 #7

"Bob Barrows [MVP]" wrote..
Bill wrote:
Are confusing this with Server.Transfer? That does not change the URL
of the browser because it redirects the SERVER to the new page.
Yes I goofed.


I do that a lot...

I just ran some tests on my server, and the url changes as it is supposed to
(using IE6)
There aren't any frames involved are there?


No, no frames. It's part of a security check application - first.asp does some security
checking, then sets a few session variables & then does a Response.Redirect to
second.asp. I'd really like the file name of first.asp to be secret - they can't do any
real damage to my security (I don't thnk!), but every time first.asp is refreshed, it
logs data info to a text file.

While I can certainly eliminate the duplicate logging, that's just fixing the symptom,
and not the cause.

Bill.


Mar 22 '06 #8
Evertjan. wrote:
I think MS got that fixed, as I didn't see that the last
months. [or, doubtfull, my programming has become better]


I still see it periodically in IE. I have never tried to figure out the
reason. Probably because I just don't care what a URL looks like as long as
it functions.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Mar 22 '06 #9
well, its a cobb but here is an idea.

run your 1st asp page, redirect them to another page that does a quick
meta-redirect to the 2nd asp page
pretty sure that will solve the problem of them not seing the 1st page url
in the browser when it is all said and done...


"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:u7**************@TK2MSFTNGP14.phx.gbl...
Evertjan. wrote:
I think MS got that fixed, as I didn't see that the last
months. [or, doubtfull, my programming has become better]


I still see it periodically in IE. I have never tried to figure out the
reason. Probably because I just don't care what a URL looks like as long
as it functions.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms. Please do not
contact me directly or ask me to contact you directly for assistance. If
your question is worth asking, it's worth posting.

Mar 22 '06 #10
and I meant to type meta-refresh
"Kyle Peterson" <ky*****@hotmail.com> wrote in message
news:uO**************@TK2MSFTNGP14.phx.gbl...
well, its a cobb but here is an idea.

run your 1st asp page, redirect them to another page that does a quick
meta-redirect to the 2nd asp page
pretty sure that will solve the problem of them not seing the 1st page url
in the browser when it is all said and done...


"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:u7**************@TK2MSFTNGP14.phx.gbl...
Evertjan. wrote:
I think MS got that fixed, as I didn't see that the last
months. [or, doubtfull, my programming has become better]


I still see it periodically in IE. I have never tried to figure out the
reason. Probably because I just don't care what a URL looks like as long
as it functions.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use of this email address implies consent to these terms. Please do not
contact me directly or ask me to contact you directly for assistance. If
your question is worth asking, it's worth posting.


Mar 22 '06 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul | last post by:
I'm not getting the results I want when I use Response.Redirct in a ASP page. I enter this line of code in a asp page from domain1.com. Response.Redirect...
3
by: Justin | last post by:
Hi, Im confused here over the usage of Response.Redirect and Server.Transfer. I used frameset for my work, what are the proper usages of the two methods that seems working similar.. The...
6
by: Sam | last post by:
I have some issues with HTTP Headers and I was hoping for some pointers or references to good articles. Here is the problem. I have 6 .aspx pages, each page contains a common .ascx. This ascx...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
5
by: =?Utf-8?B?d2ViZ3V5QGNvbW11bml0eS5ub3NwYW0=?= | last post by:
We have been running into some problems where using Response.Redirect causes the page to hang and it never actually redirects. Here's the scenario: User opens the page, selects an item from the...
2
by: Mufasa | last post by:
What are the ramifications of changing from Server.Transfer to Response.Redirect? I need to keep track of the URLs being used. Can you do relative addresses through redirect? TIA - Jeff.
6
by: sjledet | last post by:
I'm trying to figure out what I have wrong in the following code. It's located at http://www.ledet.com/locations/location.aspx If I call this page with...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.