2014-05-21 204 views
0

我希望這可以發佈第三個後續問題。原來的問題可以在這裏找到: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函數似乎都在「神奇地」再次工作。

現在我的問題是:

  1. 什麼是對的ScriptManager?
  2. 爲什麼它影響我的jQuery UI DatePicker?
  3. 如果我刪除這些行,它將如何影響項目?
  4. 如果是,我該如何解決問題?
+1

你是否包括jQuery的兩次幾個例子/教程? ScriptManager看起來像它已經包含了jQuery。 – dana

回答

1
  1. 其負責捆綁JavaScript文件爲您的網頁(S)See here
  2. 可能是很多原因,你必須檢查,看看在你選擇的JS調試器被肆意什麼錯誤。所有瀏覽器都有那麼現在是一個天
  3. 很難說,不知道任何關於你的項目
  4. 見#3
+0

它仍然不能解釋爲什麼刪除ScriptManager將使jQuery函數再次工作。另外,我使用js調試器進行測試,沒有發生錯誤 –

相關問題