Master Page Issue
-
Hi... How can i perform the body Onload event of a content page, while using Master Page. Since there is only one body tag in the Master Page. Thanks in Advance Mahesh.J
Put an id and runat="server" in the body control so that you can reach it from code behind. Put a property in the master page that exposes the control publically, so that you can reach it from the content page. In the content page you have to cast the Page.Master property to the actual class of the master page to be able to reach the property in the master page.
--- single minded; short sighted; long gone;
-
Hi... How can i perform the body Onload event of a content page, while using Master Page. Since there is only one body tag in the Master Page. Thanks in Advance Mahesh.J
Hello, You can add the following code to the aspx page
<!-- function LoadPage(event) { alert('Load') } document.body.onload=LoadPage; //-->
It's strange but it works only if you write rigth in aspx file, it did not work when I try to use RegisterStartupScript. I hope this will help you : )