IFrame problem.

Discussion in 'ASP .Net Web Services' started by bluewind44, Feb 27, 2006.

  1. bluewind44

    bluewind44 Guest

    I have a webpage "WebForm1.aspx" that have a IFrame page "IFrame.aspx".
    I know that I can access the IFrame.asax 's controls by jscript in
    "WebForm1.aspx".
    (ex) document.frames("IFrame").document.all.txtExample.value = 'ss';

    Now I want to access jscript in "WebForm1.aspx" from "IFrame.aspx".
    Is there any way to do it?
    (Especially, I want to change the textbox in "WebForm1.aspx" when a
    button event in
    "IFrame.aspx" occurs.)
    Please Help me out. T.T
     
    bluewind44, Feb 27, 2006
    #1
    1. Advertising

  2. bluewind44

    Josh Twist Guest

    This should do the trick.

    window.parent.document.all.txtExample.value = 'ss';

    I should point out that you're following an IE only route at the
    moment. Maybe try these cross-browser compatible examples instead.

    window.frames("IFrame").document.getElementById('txtExample').value =
    'ss';
    window.parent.document.getElementById('txtExample').value = 'ss';

    Hope that helps

    Josh
    http://www.thejoyofcode.com/
     
    Josh Twist, Feb 27, 2006
    #2
    1. Advertising

  3. bluewind44

    bluewind44 Guest

    Thanks a lot.
    It will help me a lot.
     
    bluewind44, Feb 28, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    729
  2. mi
    Replies:
    4
    Views:
    14,321
    dorayme
    May 21, 2008
  3. elca
    Replies:
    0
    Views:
    600
  4. Scott
    Replies:
    6
    Views:
    1,026
    [MSFT]
    Apr 14, 2004
  5. Daedalous
    Replies:
    3
    Views:
    829
    Daedalous
    Jan 16, 2004
Loading...

Share This Page