SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    canada
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Onclick Event pass value to iFrame Form

    I have a page called "Search.aspx" that includes a repeater control which has a link within the repeater. The link uses fancyzoom to popup a hidden div, the hidden div uses an iFrame to call "form.aspx".

    I need to pass a value pulled from the DB using <%#Container.DataItem("hotelName")%> to the "form.aspx" in the iFrame.

    Here's my code so far:

    LINK
    Code:
    <a href='#<%#Container.DataItem("id")%>' OnClick="LinkButton1_Click">More Info</a>
    CODE BEHIND FOR SEARCH.ASPX
    Code:
    Protected Sub LinkButton1_Command(ByVal sender As Object, ByVal e As CommandEventArgs)
    
            
            Dim hotelName As String = Request.Form("hotelName")
    
            'do I convert hotelName to a Private Querystring?
    
        End Sub
    CODE BEHIND FOR FORM.ASPX
    Code:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
            Dim hotelName As String = Request.QueryString("hotelName")
    
        End Sub
    Can someone lead me in the right direction please. This mind boggling.

    Thanks!

  2. #2
    Non-Member
    Join Date
    Oct 2007
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not possible. I didn't even read your post, because the title contains the answer. Unfortunately it's not possible to control or manipulate anything inside of an <iframe>. In some outdated browsers that don't support the idea of security it might be possible, but in newer ones, you only have a window object to control, which is the window you're in. The other way around however is possible. A page loaded from within an iframe can control the window loading the page it's in.

    for instance:

    window.parent.location = 'http://sitepoint.com/';


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •