kw said:
In a server control, is there any way to access the PAGE and modify the BODY
element ONLOAD attribute? For example:
<body onload="RunMyJS()">
As I understood you've just wanted to run some script when you control
has been loaded on page.
Sometime I use Page.RegisterClientScriptBlock on server side (it is
quite simple way)
or I solve this problem in more sophisticated way using behaviour with
event ondocumentready like this:
---- mycontrol.cs
mycontrol.Style.Add("BEHAVIOUR", "url(behaviourPath.htc)"));
------
---------- behaviourPath.htc
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="ondocumentready" ONEVENT="RunMyJS()"
</PUBLIC:COMPONENT>
<SCRIPT LANGUAGE='JSCRIPT'>
function RunMyJS()
{
}
</SCRIPT>
----------