title: how can get innerhtml of a server side element with c# (with another server-side controls inside)
body: <p>how can get innerhtml of a server side element with c# (with another server-side controls inside)?<br>
  or what is the best way for designing email body with visual studio 2010?<br>
  i have some codes in c# for sending emails ...(supporting html body)<br>
  so i am looking for a way for scape of hardcoding html body!<br>
  and so made a server side div in design mode:  </p>
  
  <pre><code>    &lt;div runat="server" id="MainDiv" style="direction: rtl; font: 12px tahoma,arial,sans-serif; width: 700px;
          background-color: #f5f5ff; border: 2px solid #003366;"&gt;
          &lt;div id="Header" style="width: 690px; background-color: #637eb0; height: 40px; margin: 5px auto;
              position: relative;"&gt;
              &lt;img src="Images/logo.png" alt="logo" title="soscharge" style="width: 200px; position: absolute;
                  top: 4px; left: 10px;" /&gt;
              &lt;span style="color: #69fbfd; font: bold 13px tahoma,arial,sans-serif; position: absolute;
                  top: 11px; right: 10px;"&gt;hi ...&lt;/span&gt;
          &lt;/div&gt;
          &lt;div id="Content" style="padding: 10px 10px;"&gt;
              &lt;ul style="margin:0px;padding:0px 10px 10px 10px;"&gt;
                  &lt;li&gt;
                  title1 : ---
                   &lt;/li&gt;
                  &lt;li&gt;
                      title 2 : 
                      &lt;asp:Label ID="lblOredr_Id" runat="server" Text="---" ForeColor="Red"&gt;&lt;/asp:Label&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
              &lt;br /&gt;
              &lt;p style="text-align: center;color:#fd00dc;"&gt;
                  bla bla&lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>but i can n't get innterHtml of this div for my email body by below code :  </p>
  
  <pre><code> string s = MainDiv.InnerHtml.ToString();  
  </code></pre>
  
  <p><strong>ERROR :</strong>   </p>
  
  <blockquote>
    <p>Cannot get inner content of MainDiv because the contents are not
    literal.  </p>
  </blockquote>
  
  <p>also i have a server side table inside MainDiv And i want to add some data dynamically to this table.<br>
  with this situation what can i do for getting html for email body ?<br>
  thanks in advance</p>