I am developing Web Application. In that i am using so many Div to open pop ups. Now my requirement is to create dynamic Div for that popup and all the content of that div comes from the Database.
So can anyone tell me how to create Div dynamically programatically?
My Sample code for Div..
<div id="Popup" runat="server" class="hidden-content">
<table width="auto">
<tr>
<td style="font-size: 20px; font-weight: bold; text-align: center;">
<p>
</p>
<b>Diabetes</b>
</td>
</tr>
<tr>
<td style="font-size: 15px; text-align: left;">
<p>
Type I diabetes (also known as juvenile diabetes) is the less common form of diabetes.
It usually is diagnosed during childhood or teen years and requires treatment with
insulin.
</p>
</td>
</tr>
</table>
</div>
I would insert either a PlaceHolder or a Literal control into you page and insert the html controls/text on PageLoad or PageRender.
If you use the Placeholder control you can create the content using the HTML controls in System.Web.UI.HtmlControls.
By using the Placeholder control, you could also write a custom WebControl that you could re-use in other locations within your site. This could then be added to the placeholder control at runtime.
For a liteal, you can just append the control div HTML as text.