Solved

HOW TO GET PARENT FRAME NAME

Posted on 2002-05-15
6
598 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
[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
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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 informatio…
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 is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

688 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