Can you tell me how to append the line @Html.Partial("_Layout") to <div class="demo"> by jQuery?
I have tried it, but it doesn't work:
<input type="button" id="btn" value="Click me" />
<div class="demo">
</div>
jQuery code:
$('#btn').click(function(){
$('.demo').append('@@Html.Partial("_Layout")');
$('.demo').html($('.demo').text());
});
But the result I received was:
<div class="demo">
@Html.Partial("_Layout")
</div>
Browser understood that @Html.Partial("_Layout") is a plain text, not a Razor syntax.
Please tell me how to fix it? Many thanks!!!
.cshtmlfile. If one, it will throw error.