Set ID name from Code Behind

I have a masterpage that has a body tag. The body tag includes an ID which I would like to set dynamically via the code behind for each page. I have not figured out how this is done and if it is possible. Does anyone have any suggestions?

Maserpage CODE:


<body id='<%=activename%>'>

CODE Behind:


Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
 Dim activenaver As String = "about"
        activename = activenaver
End Sub

THANKS!

Why don’t you just use this in the master page:

<asp:contentplaceholder runat="server" id="bodyPlaceholder">
    <body>
</asp:contentplaceholder>

And then override it in your pages:

<asp:content id="contactContent" contentplaceholderid="bodyPlaceholder" runat="server" enableviewstate="false">
    <body id="whatevs">
</asp:content>

You can also use the MasterType page directive on the content pages. Then use a public string and then set this.Master.activename in the content pages.

worked perfectly, thanks imaginekitty