473,408 Members | 1,908 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,408 software developers and data experts.

ServerVariables("URL") return incorrect pagename

Hi,
From Page1.asp, I use "Server.transfer" to "REDIRECT" to another asp page
(page2.asp),
in page2.asp I use Request.ServerVariables("URL") and
Request.ServerVariables("REFERER") to get the lastpage and the actual page,
this method (or property) return incorrect values: "Page1.asp" and ""

Why?
Martin

Aug 18 '05 #1
4 2437
Server.Transfer is not a redirect and does not register a referral. The
ServerVariables collection is correct. Did the URL in your browser change
to page2.asp? No. Did you loop through *all* of the servervariables?

"Martin" <ma******@freenet.de> wrote in message
news:%2********************@TK2MSFTNGP10.phx.gbl.. .
Hi,
From Page1.asp, I use "Server.transfer" to "REDIRECT" to another asp page
(page2.asp),
in page2.asp I use Request.ServerVariables("URL") and
Request.ServerVariables("REFERER") to get the lastpage and the actual
page,
this method (or property) return incorrect values: "Page1.asp" and ""

Why?
Martin

Aug 18 '05 #2
Martin wrote:
From Page1.asp, I use "Server.transfer" to "REDIRECT" to another asp
page (page2.asp),
in page2.asp I use Request.ServerVariables("URL") and
Request.ServerVariables("REFERER") to get the lastpage and the
actual page, this method (or property) return incorrect values:
"Page1.asp" and ""

Why?


RTM:

Method: Server.Transfer
Description: Sends all of the current state information to another
.asp file for processing.

http://msdn.microsoft.com/library/en...0507db91a5.asp
Server.Transfer Method
The Transfer method sends all of the information that has been
assembled for processing by one .asp file to a second .asp file.

http://msdn.microsoft.com/library/en...38c2a61317.asp
That's why.
--
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.
Aug 18 '05 #3
Simply put, Server.Transfer transfers execution to a different page on
the server. This is transparent to the URL that was requested by the
browser. Consquently, Request.ServerVariables("URL") would reflect
whatever page was requested by the browser.

Try using Request.ServerVariables("SCRIPT_NAME") or
Request.ServerVariables("PATH_INFO") to acheive the desired results.
I'm not positive that even these will work however, as the execution of
the page2 may still be viewed in the context of page1.

Aug 18 '05 #4
Thanks, I will try it

"Mike" <mb****@cramerdev.com> schrieb im Newsbeitrag
news:11**********************@g47g2000cwa.googlegr oups.com...
Simply put, Server.Transfer transfers execution to a different page on
the server. This is transparent to the URL that was requested by the
browser. Consquently, Request.ServerVariables("URL") would reflect
whatever page was requested by the browser.

Try using Request.ServerVariables("SCRIPT_NAME") or
Request.ServerVariables("PATH_INFO") to acheive the desired results.
I'm not positive that even these will work however, as the execution of
the page2 may still be viewed in the context of page1.

Aug 18 '05 #5

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

Similar topics

2
by: JW | last post by:
I use Request.ServerVariables("HTTP_REFERER") to get the URL of the referrer page. However, if the page that has Request.ServerVariables("HTTP_REFERER") is in a popup window then the value is...
1
by: JW | last post by:
Sorry, posting this twice as it tagged on to a spetember posting: --------------------------------------------------------------- I use Request.ServerVariables("HTTP_REFERER") to get the URL of...
4
by: JT | last post by:
if i am using https, will this work the same as if i were using http? Request.ServerVariables("HTTP_HOST") returns www.mywebsite.net for http. what about https?????
1
by: Elliot M. Rodriguez | last post by:
..NET Framework 1.1 Has anyone reported or experienced NullReferenceException errors when accessing the HTTP_REFERER value on clients that are behind web blocking software? At least one of...
4
by: Lloyd Dupont | last post by:
I can't use Control.ResolveUrl because I need to write the conversion in a utility class. However I know the current context. How could I convert the URL to one usable by the user? -- I have...
0
by: Patrick | last post by:
Greetings, I'm running into an intermittant issue on a web site running dotNet 1.1 sp1. The global.asax the client is using is set up so that it can be used in production, developement, and...
1
by: Christian Blackburn | last post by:
Hi Gang, I'm using the following code to generate a complete URL: Session("Destination") = Request.ServerVariables("Path_Info") & "?" & Request.ServerVariables("QUERY_STRING") However that...
2
by: E L | last post by:
We have the Request.ServerVariables("SERVER_NAME") used in a classic ASP page using IIS 6. It used to return our website name: www.xxx.name.this when using IIS 5, now it is returning the IP...
2
by: Henry Stock | last post by:
I don't seem to understand how to use the value: Request.ServerVariables("remote_addr") I am trying to pass the ip address of a sending web client in the body of an email message. When I...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.