IFrame problem.

B

bluewind44

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
 
J

Josh Twist

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/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top