title: populate json data into html template based on fields
body: <p>I have a requirement to populate HTML with JSON data returned from a web API call.
  The HTML is also a template file which will be exposed to the customer.
  Wherein the customer can edit some of the fields in the HTML. </p>
  
  <hr>
  
  <p>For example to remove some headers and columns etc. Assuming the HTML has table data format.
  Whenever a user clicks on a button on the client side, a web API call is performed, a JSON data is what we get.
  Now this JSON data has to be loaded onto the HTML template based on the tags it has.</p>
  
  <hr>
  
  <p>We have to use c# to populate the HTML.
  All the rendering(population of HTML) must happen on the server side.
  We may use javascript also but right now the server solution is in asp.net web-API. The main requirement is the rendering must happen on the server side using any language. 
  How to do it in C#?</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;h3&gt;Table Name&lt;/h3&gt;
  &lt;table style="width:100%"&gt;
    &lt;tr&gt;
      &lt;th&gt;Row Names&lt;/th&gt;
      &lt;th&gt;NewItems&lt;/th&gt;
      &lt;th&gt;ChangedItems&lt;/th&gt; 
      &lt;th&gt;Errors&lt;/th&gt;
      &lt;th&gt;total&lt;/th&gt;
    &lt;/tr&gt;
  
    &lt;tr&gt;
      &lt;td&gt;Types&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
    &lt;tr&gt;
      &lt;td&gt;Properties&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
    &lt;tr&gt;
      &lt;td&gt;Lists&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
    &lt;tr&gt;
      &lt;td&gt;Entries&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>JSON</strong></p>
  
  <pre><code>{
      "Compare Report": {
          "Types": {
              "NewItems": 0,
              "ChangedItems": 0,
              "Errors": 0,
              "Total": 0
          },
          "Properties": {
              "NewItems": 0,
              "ChangedItems": 0,
              "Errors": 0,
              "Total": 0
          },
          "Lists": {
              "NewItems": 0,
              "ChangedItems": 0,
              "Errors": 0,
              "Total": 0
          },
          "Entries": {
              "NewItems": 0,
              "ChangedItems": 0,
              "Errors": 0,
              "Total": 0
          }
      }
  }
  </code></pre>
  
  <p>sample table</p>
  
  <p><a href="https://i.stack.imgur.com/DqSmm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DqSmm.png" alt="enter image description here"></a></p>