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 embedded a _Layout and Header, and the Header embedded a partial view called SearchHeader.
_Layout -> View <- Header <- SearchHeader
Header:
<li id="_Header_Menu">
<div>
<ul class="sf-menu">
<li>
@Html.Partial("../Home/SearchHeader")
</li>
</ul>
</div>
</li>
SearchHeader:
<html>
<head>
<link href="@Url.Content("~/Content/fonts")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("../../Content/GlyphIcons.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("../../Content/bootstrap.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("../../Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
</head>
<body>
<input type="text" name="contentToSearch" class="form-control" id="contentToSearch" placeholder="Search">
<script src="@Url.Content("../../Scripts/boostrap.min.js")" type="text/javascript"></script>
<script src="@Url.Content("../../Scripts/jquery.js")" type="text/javascript"></script>
</body>
</html>
The css and scripts load correctly but there are applied to the Header view. How to only apply to the SearchHeader view ?
class="header-menu"or in selectors#SearchHeaderMenu > sf-menu.