I don't know if this is even possible, but here goes: I have an ASP.NET page that contains an IFrame that calls an HTML page. Is it possible to pass a variable from the ASP.NET page to the HTML within the IFrame? More specifically, I'd like for the ASP.NET page to fill in one of the fields on the form within the HTML page.
A:
You could do something like this:
window.frames['IFrameName'].document.getElementById('TextBoxID').value='YourValue';
o6tech
2010-08-23 17:34:54
I'm assuming this is javascript?
Jim Beam
2010-08-23 17:40:28
Yes, sorry. Basically, it's javascript to find the textbox element in the IFrame and set it's value. You may need to add some logic to make sure the IFrame's page is loaded, but other than that, this should work.
o6tech
2010-08-23 18:21:09
A:
If you only need it to work with the latest browsers then window.postMessage
is the way to go to communicate between frames.
DancesWithBamboo
2010-08-24 05:10:07