1. Add reference to HtmlControls on top of your 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.