|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CustomControl and body.onloadHi 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 Here's a method that I would personally NOT used butmight suit your
needs. 1) Make the page body tag of a server control. i.e. <body id="body1" runat="server"> .... </body> 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. i.e Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) MyBase.OnLoad(e) Dim body As HTMLGenericControl = Me.Page.FindControl("body") body.Attributes.Add("OnLoad", "javascript:document.bgcolor='red'") End Sub
How to add client script to a pushbutton in datagrid
How do change layout od SideBar in Wizard control? (ASP.NET 2.0) FileUpload - keep the filename GridView disapears after entering edit mode. ObjectDataSource method as another ObjectDataSource put control in a repeater cell from code behind Alignment of webcontrols... Intellisense question Master Page - File References Horizontal Menu Navigation Web Control - Spaces Between Menu Items |
|||||||||||||||||||||||