How to use @Html.PartialView("XXX") in Jquery function? <p>I have a function that updates a div with raw HTML. However, the raw HTML is in another .CSHTML document.</p> <p>My function is:</p> <pre><code>function Demo(){ $('#ContainerDiv').html('@Html.Partial("MyPartialView")'); } </code></pre> <p>For some reason, whenever I include my partial view within the function, my console shows that it is unable to locate the document.</p> <p>As soon as I remove the @Html.PartialView("MyPartialView") and include it in the body of the document, it loads fine.</p> <p>Any ideas on why this would not be working, or a better way of doing this?</p> <p>Thanks, Mark</p>