Yes, here is one possible solution:
Give your body tag the runat and id attributes:
<body runat="server" id="Body">
Then from code behind, obtain a reference to the control and make it
sumbit to your wishes:
HtmlGenericControl body = FindControl("Body") as HtmlGenericControl;
if (body != null)
{
body.Attributes["onload"] = "MyFunction();";
}
HTH,
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Sun, 13 Feb 2005 00:34:35 -0500, "SteveS" <sm*******@yahoo.com>
wrote:
Hello, I'm having trouble figuring out how to dynamically add an onload and
resize event to the <body> tag. I've looked on the web and in MS
documentation unsuccessfuly. Does anyone know the code to do this? The end
result would be something like this:
<body onload="MyFunction()" resize="ResizeFunction()">
Your help is greately appreciated!!!