Solved

HOW TO GET PARENT FRAME NAME

Posted on 2002-05-15
6
586 Views
Last Modified: 2008-02-01
Hi, In VBSCRIPT

I have an ASP page that is in a frame within a HTM page, how can i reference the name of the main page from with in this ASP page.  I need to know which site is accessin the asp, i cant use the REFERE command becuase this page if access from a previous child frame, and I need to know the name of the main HTM parent.

Any help much appriciated

Regadrs

Craig
0
Comment
Question by:publicityhouse
6 Comments
 
LVL 3

Expert Comment

by:hagur
ID: 7010726
ASP is a server side language and it will never be able to get the name of the frame from the client.

You should be able to use:
Request.ServerVariables("SCRIPT_NAME")

or maybe:
Request.ServerVariables("HOST_NAME")
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7010737
Using clientside scripting you cannot do crossdomain calls. With other words, you cannot find out the websit eon the clientsite. However, on the serverside you can get the referrer, but ONLY if they used a plain HREF link (no javascript or vbscript to change the page).

I believe the following should work
<%=Request.ServerVariables("HTTP_REFERRER")%>
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7010739
HOST_NAME returns the name of the machine making the request. That is, the client.

SCRIPT_NAME returns the relative location of the current ASP page.

CJ
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 29

Accepted Solution

by:
Göran Andersson earned 200 total points
ID: 7011735
There is no frames in ASP. The information about the frames lies entirely on the client side.

There is no site that accesses the ASP pages, it's the client that accesses the pages. It only happens to be inside a frameset that comes from another server.

In JScript, you can use top.location.href to get the address of the main frameset source. But if that's not on the same server, you get a permission denied error.

You have to pick up the referer information where it's available (on the previous page) and send it on to the page where you need the information.
0
 

Author Comment

by:publicityhouse
ID: 7013215
oh dear, I may have to re-think how the site functions.  Many thanks to all that commented.
Craig
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 7013277
B?

Should I consider to stop answering questions where there is no definitive answer?
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now