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?
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
Dim activenaver As String = "about"
activename = activenaver
Why don’t you just use this in the master page:
<asp:contentplaceholder runat="server" id="bodyPlaceholder">
And then override it in your pages:
<asp:content id="contactContent" contentplaceholderid="bodyPlaceholder" runat="server" enableviewstate="false">
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