Thursday, May 22, 2008

ASP.NET Master Pages and overriding attributes of Body tag

Default.Master page

<body id="MasterPageBody" runat="server" >
</body>

Code behind

public HtmlGenericControl Body
{
     getreturn this.MasterPageBody}
     setthis.MasterPageBody = value;}
}

Content pageRegister

<%@ MasterPage VirtualPath="~/virtual/path/to/your/master/page" %>

Code Behind

public void Page_Load(object sender, EventArgs e)
{
     this.MasterPageBody.Attributes
            .Add("onload","javascript:alert('I am here')");
}
 

No comments:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...