I need to use jQuery to add some elements dynamically. So I looked up in the internet and I found this. It is nice and working when there is plain html elements inside singl
You can create a partial page _MyPartial.cshtml in your Views Shared folder.
_MyPartial.cshtml
Then in your view reference add the reference to your scripts section
@section Scripts { @Html.Partial("~/Views/Shared/_MyPartial.cshtml",Model); }
Partial page: _MyPartial.cshtml
@model MyViewModel