我使用Visual Studio 2012和内置模板(在Add - > New Project下)创建一个全新的ASP.NET Web Forms Web应用程序项目。在默认情况下提供的Site.Master页面中,我看到了一些针对JQuery的标记,它包含在下面。在ASP.NET Web Forms 4.5中绑定JQuery
ASP.NET如何找出包含JQuery的路径,给定以下标记?
<asp:ScriptManager runat="server">
<Scripts>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<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“〜/脚本/ jQuery的1.7.1.js”。我看到一个packages.config文件,但它没有明确描述必须以某种方式计算的路径。
有谁知道如何在运行时解决JQuery的JavaScript文件路径?
你的解决方案中没有“脚本”文件夹吗? – Thousand
看看你在这里的其他问题:http://stackoverflow.com/questions/12290537/vs2012-web-forms-bundling- confusion答案似乎提供了一些澄清,我认为。答案似乎表明,这些包将jQuery文件放置到脚本文件夹中,然后在运行时从那里自动添加这些文件,而无需进一步引用。 – Nope
简:是的我有一个脚本文件夹w /所有的jQuery JavaScript文件在那里......但我的问题是如何生成此目录的路径。 – ClearCloud8