Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get the parent URL for an iFrame

Posted on 2013-05-28
5
Medium Priority
?
913 Views
Last Modified: 2013-08-13
I have a page on one domain.  (www.mypage.com/mydirectory/defaults.asp)

Within this page is an iframe that points to a different URL.  (www.differenturl.com/calendar.aspx)

When the calendar.aspx page loads in the iFrame I need it to get the URL of the page that loaded the iFrame.  So basically I need it get this:

www.mypage.com/mydirectory/

Is there a way to do this?  If so, can you please explain how.  Thanks!
0
Comment
Question by:cdemott33
[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
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:RaithZ
ID: 39202389
That may be listed in the referrer information in the http headers.
0
 

Author Comment

by:cdemott33
ID: 39202401
Is there a way I could get this information using VB.NET?  If so, how?
0
 
LVL 13

Accepted Solution

by:
Jitendra Patil earned 2000 total points
ID: 39204236
Hi cdemott33

try this way,

.aspx code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
        <body>
            <form id="form2" runat="server">
            <iframe id="Iframe1" runat="server" src="http://www.google.com" height="200px" width="200px"></iframe>
            <asp:Button ID="btnget" runat="server" Text="GetParentURL" />
            </form>
        </body>
</html>

.vb code

Imports System.Data
Public Class _Default
    Inherits System.Web.UI.Page
   
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       
    End Sub

    Protected Sub btnget_Click(sender As Object, e As EventArgs) Handles btnget.Click
        Response.Write(Request.UrlReferrer.ToString())
    End Sub
End Class

hope this helps.
0
 

Author Comment

by:cdemott33
ID: 39204490
Hi  patil786 -

When I click the button the response.write displays "www.google.com".  I want to get www.mypage.com/mydirectory/defaults.asp. Any thoughts on how I can do this?
0
 
LVL 13

Expert Comment

by:Jitendra Patil
ID: 39204714
can you post your code here.

are you referring any google code like google checkout, payment gateway etc..
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

715 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