Call Jquery function inside razor's subviews

后端 未结 1 1775
慢半拍i
慢半拍i 2021-01-28 19:43

I want to use such an activity $(\'#myModal\').show();

The original calling plugin routine is as follows:



        
1条回答
  •  梦毁少年i
    2021-01-28 19:59

    If you are including a Partial view called Foo.cshtml you could also create a partial view named FooScripts.cshtml and render that view where the rest of your scripts are getting loaded:

    Main View

    @Html.Partial("Foo") ... @section scripts { @Scripts.Render("~/bundles/jquery") @Html.Partial("FooScripts") }

    0 讨论(0)
提交回复
热议问题