Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, you're thinking of a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.usercontrol.aspx" rel="nofollow noreferrer">UserControl</a>. Extract the relevant HTML out, paste it into a UserControl .ascx template.</p> <p>Now in your case, you'll probably want the text to be customizable, am I right? So you'll need to replace the <code>&lt;h1&gt;</code> through <code>&lt;/p&gt;</code> bit with an ASP.NET label. The resulting .ascx HTML (not counting the <code>@Control</code> directive) will look something like:</p> <pre><code>&lt;div id="BottomBody"&gt; &lt;div class="box1024" &gt; &lt;div class="content1024"&gt; &lt;div class="top1024"&gt;&lt;/div&gt; &lt;asp:Label runat="Server" id="label1" /&gt; &lt;/div&gt; &lt;div class="bottom1024"&gt; &lt;div&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Alternatively, you could do two labels -- one for the header, one for the main text. Or even just have the header be <code>runat="Server"</code> itself.</p> <p>Next, you'll write a little bit of code in the .ascx code-behind file to expose the label's (or labels', as the case may be) <code>Text</code> property. This would probably look something like:</p> <pre><code>public string Text { get { return label1.Text; } set { label1.Text = value; } } </code></pre> <p>If you're in an ASP.NET MVC world, use your <code>Model</code> data instead of a label, and pass in the desired display text <code>string</code> as the model data. </p> <h2>Edit</h2> <p>Addressing the update to the question:</p> <blockquote> <p>One additional thing to note, the number HTML tags used inside the inner most DIV will change depending on where I use it in my site. So in some cases I will only have 1 tag and 1</p> <p>tag but in other cases I could have 1 tag, 1</p> <p>tag, 3 tags, and a HTML table. How can I make that work?</p> </blockquote> <p>The exact same technique, assuming that the content you're referring to is what's within <code>&lt;div class="content1024"&gt;</code>. The <code>Text</code> property of a label can contain any desired arbitrary HTML, and of course you can pass any arbitrary amount of HTML as a string to the Model if you're using MVC.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload