R
Roberto Kohler
How do I reference the masterpage body element in ASP.NET 2.0 server code ?
I tried the following, but I get the error "hgcMasterBody is not a member of
System.Web.UI.MasterPage"
In the Master Page:
<body id="hgcMasterBody" runat="server">
.....
</body>
In the ASPX page:
<%@ MasterType virtualpath="MyMasterPage.master" %>
.....
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Master.hgcMasterBody.Attributes("bgcolor") = "lightblue"
End Sub
</script>
I tried the following, but I get the error "hgcMasterBody is not a member of
System.Web.UI.MasterPage"
In the Master Page:
<body id="hgcMasterBody" runat="server">
.....
</body>
In the ASPX page:
<%@ MasterType virtualpath="MyMasterPage.master" %>
.....
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Master.hgcMasterBody.Attributes("bgcolor") = "lightblue"
End Sub
</script>