I have a masterpage that is completely built by doing a response.write. All of the HTML comes from the database. The HTML has content sections that look like the following

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

The problem is, is that if I put that code with the asp:ContentPlaceHolder in the html, it will not render correctly since the code behind is just doing a response.write of the html as it is and asp:ContentPlaceHolder isn't translated into the rendered html that .net creates for you.

One option is to place the contentplaceholder in the master page beforehand and still do the response.write in the page_load of the code behind. The problem with that is that the contentplaceholder is above the html rather than in the middle of the html.

Does anyone know how I can keep my masterpages html in the database, but still have the ability to use content place holders within my html?


7 Years
Discussion Span
Last Post by Ahmad239

have you tried putting 2 literal controls
one above the ContentPlaceHolder and one beneath it
and you end the first one with a <div>
and start the second literal with a </div>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.