Mam prosty widok i chcę dodać JQuery DatePicker JavaScript do tego widoku (a nie każdy widok, poprzez stronę wzorcową).Jak dodać JavaScript do widoku ASP.NET MVC?
Nie jestem pewien, jaki jest najlepszy sposób na zrobienie tego.
Po drugie, mam świadomość, gdzie/kiedy ładuje się JavaScript. Jestem fanem YSlow i poleca dodanie skryptów na dole strony, co robię.
Jak mogę zrobić jedno i drugie?
oto widok:
<%@ Page
Language="C#"
MasterPageFile="~/Views/Shared/Site.Master"
Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<h2>Index</h2>
<% using (Html.BeginForm()) {%>
<p>
<label for="StartDate">Start Date:</label>
<!-- JQuery DatePicker to be added, here. -->
</p>
<% } %>
</asp:Content>
Cheers :) Dla przypomnienia, dodałem nową ContentPlaceHolder na dnie stronę, tuż nad tagiem