Advertisement

06.01.2008 at 08:05AM PDT, ID: 23448108
[x]
Attachment Details

How to get the parent url from iFrame (written in aspx) contained in parent URL's page

Asked by BrainyYack1 in WebApplications, JavaScript, Programming for ASP.NET

Tags: JavaScript C# Asp.net HTML, IE

  I know using javascript (window.parent.location.href) may get the parent url. But within iframe there aspx web pages. How can we pass the variables in Javascript to aspx.
 
    The reason to do this is that the functions within iframe depends on the parent url. that is, differnt parent url with the same iframe will work differently.  First we can use "<iframe src ="http://12.34.56.78/function.aspx?name=a111">, from the QueryString "name", I can tell which parent (url) is calling the iframe. We store the "name=a111" in the session so that every aspx page get the "name=a111" from seesion and run different fucntions acccording to the "name=a111".  The problem is: afterwards, if session is timeout, we lost the information of "name=a111", thus lost the information of which parent url is calling the iframe.

     Our questions are:
     (1) how to get the parent url from iframe written in aspx?
     (2) or there are any other places than sesstion to store the information that is related with parent url?

    Thanks.

  Start Free Trial
 
Loading Advertisement...
 
[+][-]06.01.2008 at 12:11PM PDT, ID: 21688097

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.01.2008 at 01:02PM PDT, ID: 21688252

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: WebApplications, JavaScript, Programming for ASP.NET
Tags: JavaScript C# Asp.net HTML, IE
Sign Up Now!
Solution Provided By: Zvonko
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628