Solved

HOW TO GET PARENT FRAME NAME

Posted on 2002-05-15
6
588 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can i convert a Generic list to DataTable in c# 3 771
add custom headers to my mail 2 48
How to speed up an ASP/MS SQL web application 6 70
Need help to rewrite script 3 68
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

896 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

14 Experts available now in Live!

Get 1:1 Help Now