All I want to do is access the element <body>from the code for the content page and add the class name to it.
I have a top level main page with an element <body>. Then I have a nested main page, which is the main page for the content page. From the code behind the content page, I want to add the class name to the body element. It's all.
I have this with the top-level master:
<body id="bodyNode" runat="server">
I added this to the code for the content page:
Master.bodyNode.Attributes.add("class", "home-page");
And I get a message that:
System.Web.UI.MasterPage 'does not contain a definition for' bodyNode
If I add this to my aspx content page:
<% @ MasterType VirtualPath="~/MasterPage.master"%>
Then the message will change to:
bodyNode unavailable due to protection level
, , , 2 , -, : (