Add CSS references to page's <head> from a partial view

后端 未结 6 2396
感动是毒
感动是毒 2021-02-20 02:21

Is there a way to add CSS references to a page from a partial view, and have them render in the page\'s (as required by the HTML 4.01

6条回答
  •  一生所求
    2021-02-20 03:01

    If you're using MVC3 & Razor, the best way to add per-page items to your section is to: 1) Call RenderSection() from within your layout page 2) Declare a corresponding section within your child pages:

    /Views/Shared/_Layout.cshtml:

    
        
         
     
    热议问题