Groups | Blog | Home
all groups > asp.net webservices > february 2006 >

asp.net webservices : IFrame problem.


bluewind44
2/26/2006 10:18:27 PM
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
2/26/2006 11:46:03 PM
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
2/28/2006 12:07:44 AM
Thanks a lot.
It will help me a lot.
AddThis Social Bookmark Button