我在WebForms項目中尋找一個奇怪的錯誤,我無法找到第二個jQuery參考的來源。如何在WebForms中找到流氓腳本調用的來源
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-1.10.2.min.js",
//additional entries omitted
));
現在這個包被稱爲在我的母版頁文件:
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/jquery") %>
<%: Styles.Render("...") %>
</asp:PlaceHolder>
只要用戶停留在網頁的根文件夾(www.domain.com/page
)evertyhing工作正常。不幸的是,當用戶被重定向到位於子文件夾的aspx頁面顯示(www.domain.com/subfolder/someotherpage
)以下錯誤:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:53078/Scripts/jquery-1.10.2.js
我搜索的整體解決方案,但無法找到部分,在這源自於。
綜觀呈現的源代碼,我看到這一點:
<body>
<script src="../Scripts/jquery-1.10.2.js" type="text/javascript"></script>
</body>
現在,這看起來並不像被捆綁提供的腳本標記,分別位於頭部。鑑於腳本標籤的位置,這應該從母版頁文件起源,但我不能把它我的手指:
<head runat="server">
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/jquery") %>
<%: Styles.Render("~/bundles/Stylesheets") %>
</asp:PlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" EnableEmbeddedjQuery="false">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryExternal.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryPlugins.js" />
</Scripts>
</telerik:RadScriptManager>
<%: Scripts.Render("~/bundles/UiEffects") %>
</body>
之前你的建議吧:我已經試過用香草代替RadScriptManager asp:ScriptManager
,但無濟於事。
是否有可能從asp.net web項目中的哪一行代碼中確定腳本引用來自哪裏,因此我可以消除它?