28 Jul 2010
17 Nov 2010
Link to this post
I need to grab some data from my DB, then insert it into some markup. For example:
<p>Some more text</p>
My first idea was to create a User Control that grabs the data and then just displayed it in a <asp:Label /> or <asp:Literal>. Since I can't insert a User Control in a Generic Content module, I was going to surround my User Control with two Generic Content modules. The first would include my markup up to and including the <p> for the DYNAMIC DATA. The second would start at the </p> for the DYNAMIC DATA and then finish out the page.
I figured it wouldn't look right in the admin, but everything should come together when the page is rendered live. However, the first Generic Content module sees my missing closing tags and automatically fills them in.
Is there a way to tell the Generic Content module not to fix broken markup?
Or, is there a better way to integrate data driven content in the middle of my markup?