title: Adding a partial View using @Html.Partial("viewname") to the body of div using Jquery in MVC
body: <p>Below is the Html and Jquery code. When i am trying to add the partial view using <code>$(".divclass").html(@Html.partial("....");</code> it navigates directly to the partial view instead of loading in the bootstrap modal div. While debugging i saw the above mentioned line is giving error saying "Illegal character" but the partial view content is coming properly. Can anybody help on this?</p>
  
  <pre><code>@section Scripts {
      &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              alert("javascript working fine");
              $("#createnew").on("click", function (e) {
                  e.preventDefault(); //Prevents the default behaviour of element
                  alert($(this).attr('href'));
                  $(".modal-title").text("Create New");
                  $(".modalbody").html(@Html.Partial("~/Views/Shared/_PartialViewTest.cshtml"));
                  $("#myModal").modal('show');
              })
          })
      &lt;/script&gt;
  }
  </code></pre>
  
  <p>Html:</p>
  
  <pre><code>&lt;!--partialview--&gt;
  &lt;h2&gt;
      This is a partial view
  &lt;/h2&gt;
  
  
  &lt;div class="container"&gt;
      &lt;!-- Modal --&gt;
      &lt;div class="modal fade" id="myModal" role="dialog"&gt;
          &lt;div class="modal-dialog"&gt;
  
              &lt;!-- Modal content--&gt;
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                      &lt;h4 class="modal-title"&gt;&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class="modalbody"&gt;
  
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>