Changing text in another frame

  • Thread starter Thread starter adrian
  • Start date Start date
A

adrian

I'd be very grateful if anyone could help me.
I have a frame based setup and from within my main frame
I'm trying to change some text in the header frame. I'm
dabbling with javascript and have succesfully changed the
source of an image using the script:

window.parent.frames(0).document.forms['Header'].elements
['Logo'].src="images/logo_dura.gif";

However I can't seem to do the same with some text I have
rendered as an ASP:label. I'd be prepared to use any tag
if it worked.

Any ideas???

Many Thanks

Adrian
 
This is why using frames in .NET is generally a bad idea.
Usually you're better off partitioning logical sections of your page into
web user controls.
Here's more info:
http://msdn.microsoft.com/library/d...n/html/vbconintroductiontowebusercontrols.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp
http://msdn.microsoft.com/library/d...l/vbconWebUserControlsVsCustomWebControls.asp

If you're determined to keep using frames you may be able use some
javascript similar to this to do the job.
window.parent.frames(0).document.all.item("MyLabel1").innerhtml='whatever';
 
This one is for a textbox, shud be same/similiar for label

parent.frames.item("toprightframe").document.all.MyTextBox.value = "Zane
Grey";
 
Back
Top