Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to give two onload function in body.
XML
<BODY onLoad="init();update()" >

this works fine but it fires for all page . so IE shows error.
if i use id in body then use in content page
C#
protected void Page_Load(object sender, EventArgs e)
    {
        Masterpages_MasterPage masterPage = this.Master as Masterpages_MasterPage;
        masterPage.Body.Attributes.Add("onLoad", "photoGallery();");
    }


it works fine, but if I use in masterpage
C#
protected void Page_Load(object sender, EventArgs e)
    {
        Body.Attributes.Add("onLoad", "startTime();");     
    }

masterpage-works , contentpage does not work.
Posted
Updated 20-Jun-10 19:37pm
v2
Comments
Rob Branaghan 28-Jun-10 4:38am    
What are you trying to Achieve?

1 solution

You'll want to investigate javascript event chaining to handle this.

http://juixe.com/techknow/index.php/2007/06/20/chain-javascript-events/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900