Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Modify <body> onload in usercontrol.aspx.vb


Message #1 by "Peter Lanoie" <planoie@n...> on Wed, 4 Dec 2002 11:07:58 -0500
I'm working in a user control that gets included in a master page template.
Unfortunately, I can't modify the raw HTML body tag in the template to add
in my necessary JavaScript call.

Is there a way to access a page's (or a control's container page) body tag
in the user control code behind?  I've been poking around the
infrastructure, been searching on the P2P archives and doing general web
searches.  All I have found so far is "<body onload=...".  Ideally, I'd like
to be able to add my piece on such that any existing onload value remains,
and I can just add my function call onto it.

The only alternative I have thought of, which I have yet to get working is
creating some properties/methods in the template itself which allow me to
"append" to the onload routine so when the template is drawn it outputs that
where appropriate.  But given that a user control is separate and apart from
the template, and is only added into the template at runtime, I can't seem
to get a hook between them.

Anyone have any ideas?

TIA,
Peter


  Return to Index