S
Shikari Shambu
Hi,
I have an ASP.NET website that has pages that inherit from a BasePage. I
want all pages to have some common Javascript functions.
I tried doing the following
In the Base Page
protected System.Web.UI.HtmlControls.HtmlGenericControl body;
protected void Page_Load(object sender, System.EventArgs e)
{
body.Attributes.Add("onload","javascript:alert('Hello World')");
}
And, when I access the child page MyPage.aspx I get
Object reference not set to an instance of an object.
How do I add same javascript to the body onload tag of all my pages.
TIA
I have an ASP.NET website that has pages that inherit from a BasePage. I
want all pages to have some common Javascript functions.
I tried doing the following
In the Base Page
protected System.Web.UI.HtmlControls.HtmlGenericControl body;
protected void Page_Load(object sender, System.EventArgs e)
{
body.Attributes.Add("onload","javascript:alert('Hello World')");
}
And, when I access the child page MyPage.aspx I get
Object reference not set to an instance of an object.
How do I add same javascript to the body onload tag of all my pages.
TIA