title: How can I return the HTML from MVC controller to a div in my view
body: <p>I'm trying to return the generated HTML string to the view to dynamically generate a HTML table with results. I'm not able to get the returned HTML string any suggestions and help is greatly appreciated.</p>
  
  <p>Here is my Controller code</p>
  
  <pre><code>    public ActionResult ValidateTrams()
      {
          string html = "";
          if (Request.Files.Count == 0 || Request.Files[0].ContentLength == 0)
          {
          }
  
          else
          {
              html = ProcessTextFile(Request.Files[0].InputStream);
          }
  
          return View(html);
      }
  </code></pre>
  
  <p>I'm trying to grab this returned result in jquery like this</p>
  
  <pre><code>$('#tramsView').live('click', function () {
  
  $.ajax({
      url: '/Booking/ValidateTrams',
      type: 'POST',
      dataType: 'jsonp',
      success: function (data) {
          alert(data);
          $('#TramsViewFrame').html(data);
      },
      error: function (jqxhr, textStatus, errorThrown) {
          $(window).hideWaitScreen();
          if (confirm(errorThrown)) { window.location.reload(); }
      }
  });
  </code></pre>
  
  <p>});</p>
  
  <p>Finally Below is the CSHTML for the form. Here I'm reading a file from a form with a button type submit</p>
  
  <pre><code>&lt;form action="#" method="post" enctype="multipart/form-data" class="forms" name="form"
              id="frmvalidate"&gt;
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;input type='file' name='trams' id='ValidatetramsFile' /&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;br /&gt;
                          &lt;input name="cbDisplayUmatched" id="cbDisplayUmatched" type="checkbox" value="" checked="true" /&gt;
                          &lt;label style="text-decoration: none; outline: none; font-size: 1.1em; padding: 3px 0 0px 0;"&gt;
                              Display rows that were &lt;strong&gt;NOT&lt;/strong&gt; parsed&lt;/label&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;br /&gt;
                          &lt;div class="buttons"&gt;
                              &lt;button type="submit" value="VIEW" class="ui-state-default ui-corner-all" id="tramsView"&gt;VIEW&lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>Thanks for your time and really appreciate your help. Kind Regards!!!</p>