Solved

HOW TO GET PARENT FRAME NAME

Posted on 2002-05-15
6
590 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

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 …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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