?
Solved

Get IE address bar contents using ASP

Posted on 2005-03-29
4
Medium Priority
?
387 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

801 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