views:

33

answers:

0

I'm attempting to put some javascript into the body tag of my masterpage using the following techinique:

<body id="pgBody" runat="server">

//Property to get the body tage in MasterPage.cs
public HtmlGenericControl BodyTag
{
    get
    {
        return this.pgBody; 
    }
}


//In my content page PageLoad()
MasterPage mstrPg = this.Master as MasterPage;
if (mstrPg != null)
{
     mstrPg.BodyTag.Attributes.Add("onload", "LoadMap()");
     mstrPg.BodyTag.Attributes.Add("onunload", "UnloadMap()");
}

Everything works as expected when running on my local machine (using the Visual Studio Development Server), but when I deploy it out to a production IIS 6 server the attributes do not get added to the body tag when running the page.

Any ideas on what would cause this?