Call Jquery function inside razor's subviews

后端 未结 1 1774
慢半拍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条回答
  • 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:

    <h2>Main View</h2>
    
    @Html.Partial("Foo")
    
    ...
    
    
    @section scripts {
        @Scripts.Render("~/bundles/jquery")
        @Html.Partial("FooScripts")
    }
    
    0 讨论(0)
提交回复
热议问题