954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Response.Write(html) with ContentPlaceHolder in the html

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">
                                </asp:ContentPlaceHolder>


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?

Thanks.

cr40
Newbie Poster
1 post since Jun 2011
Reputation Points: 10
Solved Threads: 0
 

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

Ahmad239
Newbie Poster
4 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: