我希望這可以發佈第三個後續問題。原來的問題可以在這裏找到:jQuery DatePicker not working with MasterpageASP:ScriptManager,那是什麼?
很長時間的調查後,原來有什麼不對的JavaScript代碼在所有。相反,會出現問題,當你使用現有的模板,(我使用的是2013年)創建在Visual Studio中一個新的項目,在母版,你會發現下面一串代碼:
<asp:ScriptManager runat="server">
<Scripts>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="bootstrap" />
<asp:ScriptReference Name="respond" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%>
</Scripts>
</asp:ScriptManager>
當我刪除了上面的所有代碼,我的所有jQuery函數似乎都在「神奇地」再次工作。
現在我的問題是:
- 什麼是對的ScriptManager?
- 爲什麼它影響我的jQuery UI DatePicker?
- 如果我刪除這些行,它將如何影響項目?
- 如果是,我該如何解決問題?
你是否包括jQuery的兩次幾個例子/教程? ScriptManager看起來像它已經包含了jQuery。 – dana