문제

How to bundle style and script files using layout in asp MVC?

Here is an example.

Layout1 uses style and script file for header and footer functionality. Sections are declared.

View1 uses Layout1 . It also contains style and script files in order to make this view work. Layout sections are updated using @section Sectioname.

Is there a way to bundle all styles and script files at View1? Should I bundle only files needed for Layout1 and apply it in layout code and add View1 files in @section?

What is a good way to resolve this issue?

도움이 되었습니까?

해결책

if the scripts and styles that used in view1, will not be used in another views, the best way is to bundle them only at view1, but if they are common scripts and styles that will be used in many views, bundle them at layout.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 softwareengineering.stackexchange
scroll top