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
Josh Twist - 27 Feb 2006 07:46 GMT
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/
bluewind44 - 28 Feb 2006 08:07 GMT
Thanks a lot.
It will help me a lot.