Using sections in Editor/Display templates

后端 未结 8 951
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 17:15

I want to keep all of my JavaScript code in one section; just before the closing body tag in my master layout page and just wondering the best to go about it, M

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 17:43

    I faced the same problem, but solutions proposed here work good only for adding reference to the resource and are not very suitable for inline JS code. I found a very helpful article and wrapped all my inline JS (and also script tags) in

    @using (Html.BeginScripts())
    {
        
        
    
                                     
                  
提交回复
热议问题