1. Add the using reference to the top of your pages .cs file

   using System.Web.UI.HtmlControls;

2. In your Page_Load function of the .cs file add

((HtmlGenericControl) this.Page.Master.FindControl(“PageBody”)).Attributes.Add(“onload”, “load()”);

3. Make sure your master page BODY has the  the matching id from above. in this case: ID=”PageBody” runat=”server”

4. In your aspx file, add you load function.  something like

  <script type=”text/javascript”>
     function load() { alert(‘page loaded’); }
  </script>