Velocity Reviews

Velocity Reviews (
-   ASP .Net Web Controls (
-   -   CustomControl and body.onload (

Ernest Morariu 03-22-2006 01:22 PM

CustomControl and body.onload

Hi All !

I subclassed a Label control(ASP2.0) .
How to modify(form inside my control) the attribute onload of the <body> of
the page where my control resides?

I need the browser to execute a javascript function(when the page loads)
that my control registers with ClientScriptManager.

Ernest 03-22-2006 06:06 PM

Re: CustomControl and body.onload
Here's a method that I would personally NOT used butmight suit your

1) Make the page body tag of a server control.
<body id="body1" runat="server">
2) Use FindControl() to find the body within the subclass and inject
your javascript.
The subclassed OnLoad handler might be a good location to do this.
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
Dim body As HTMLGenericControl =
End Sub

All times are GMT. The time now is 04:42 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.