?
Solved

Get IE address bar contents using ASP

Posted on 2005-03-29
4
Medium Priority
?
390 Views
Last Modified: 2012-05-05
Hi,

How do I get the contents of the IE address bar in ASP?
with javascript I can get location.href, but that will give the URL of the current page.
In ASP, if I use Request.ServerVariables("URL"), I agin get the URL of the current page.
 If I am using frames, the content of the IE address bar will actually contain a different URL. How do I get the URL that IE has in its address bar?

Thanks,
INK777
0
Comment
Question by:ink777
  • 2
4 Comments
 
LVL 1

Assisted Solution

by:T-Dub
T-Dub earned 180 total points
ID: 13664092
try this javascript
parent.location.href
0
 
LVL 22

Accepted Solution

by:
RedKelvin earned 195 total points
ID: 13669032
You can put it together using the server environment variables

<% Response.write(Request.ServerVariables("SERVER_NAME")) %>

gives you the www name (eg www.somesite.com)

<% Response.write(Request.ServerVariables("URL")) %>

gives you the rest of the path

<% Response.write(Request.ServerVariables("QUERY_STRING")) %>

gives you any url parameters following a '?'


there are heaps of environment variables that will give you all sorts of info, check out these links
http://www.w3schools.com/asp/coll_servervariables.asp
http://www.phm.lu/Documentation/Web/EnvVar.asp
0
 

Author Comment

by:ink777
ID: 13669808
Hi,

I got what I wanted by using this.

<%
response.write request.servervariables("http_referer")
%>

Thanks
0
 
LVL 22

Expert Comment

by:RedKelvin
ID: 13669920
That's great, those environment variables are very handy, certainly got me out of trouble a couple of times.
Are you going to accept my comment?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question