I need to load css and scripts only to a specific Partial view but at this moment this link and scripts are loaded in all views. The structure that I have is the main view e
You cannot load CSS and JavaScript resources specifically for a partial view without it applying to the entire page. Therefore, you'll need to design your page styles or JavaScript to target only the relevant sections.
...
If I wanted to style the ul.menu
differently, I'd use selector rules
JavaScript
$("#header-section > .menu").css({ ... });
$("#search-header > .menu").css({ ... });
Or in a CSS file
#header-section > .menu { ... }
#search-header > .menu { ... }
Or just use distinct classes or specific ids
.header-only { font-size: 1em; }
.search-header-only { font-size: 0.85em; }
#special-item { font-size: 1.5em; }