I create two Render Section on _Layout.cshtml
bellow:
@RenderSection("scripts", required: false)
@RenderSection("scriptpartial", required: false)
Page Index.cshtml using reference from _Layout.cshtml
, on page Index.cshtml
I use define code:
@section scripts {
<script type="text/javascript">
$(document).ready(function () {
alert("This is code 1");
});
</script>
}
Page Index.cshtml
contain one partial _Other.cshtml
, in file _Other.cshtml
I define code:
@section scriptpartial {
<script type="text/javascript">
$(document).ready(function () {
alert("This is code 2");
});
</script>
}
When I running application, only "This is code 1" executed, I do not know error this