在ASP.NET Web Forms 4.5中捆绑JQuery
发布时间:2020-12-16 03:22:07 所属栏目:asp.Net 来源:网络整理
导读:我使用Visual Studio 2012和内置模板(在Add – New Project下)创建一个全新的ASP.NET Web Forms Web应用程序项目.在默认情况下提供的Site.Master页面中,我看到了一些针对 JQuery的标记,它包含在下面. 考虑到以下标记,ASP.NET如何确定包含JQuery所需的路径?
我使用Visual Studio 2012和内置模板(在Add – > New Project下)创建一个全新的ASP.NET Web Forms Web应用程序项目.在默认情况下提供的Site.Master页面中,我看到了一些针对
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解析为“?/ Scripts / jquery-1.7.1.js”.我看到一个packages.config文件,但它没有明确描述必须以某种方式计算的路径. 有谁知道如何在运行时解决JQuery的javascript文件的路径? 解决方法
在Microsoft.ScriptManager.WebForms PreAppStartCode中,它具有:
System.Web.UI.ScriptManager.ScriptResourceMapping.AddDefinition("WebFormsBundle",new ScriptResourceDefinition { Path = "~/bundles/WebFormsJs",CdnPath = "http://ajax.aspnetcdn.com/ajax/4.5/6/WebFormsBundle.js",LoadSuccessExpression="window.WebForm_PostBackOptions",CdnSupportsSecureConnection = true }); 这是与脚本引用的声明挂钩的内容: < asp:ScriptReference Name =“WebFormsBundle”/> 还有重复数据删除,因为ScriptReference路径与bundle内部文件的路径相同,应该在BundleConfig.cs中注册 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 更改ContentPlaceHolder的ID
- asp.net-mvc – ASP.NET MVC IIS7.5:将网站从W7移动到Wind
- asp.net-mvc – 在MVC WebApi中的方法如何映射到http动词?
- asp。net内置委托
- asp.net-mvc-4 – MVC 4创建slug类型url
- 获取Asp.net/iis设置Cache-control:静态文件的max-age
- asp.net-mvc – 验证消息中的换行符
- asp.net – DropDownList获取底层对象
- 我不应该将哪些ASP.NET MVC项目文件添加到Subversion
- asp.net – 建筑设计DAL层
推荐文章
站长推荐
- asp.net – jQuery flot,来自SQL Server的Live p
- 在ASP.NET RadioButtonList ListItem上设置CSS类
- asp.net – 我的项目引用了3个不同版本的mscorli
- ASP.NET:压缩ViewState
- asp.net – 恶意用户可以修改viewstate吗?
- asp.net-mvc – 注销asp.net mvc后,User.Identit
- 如何在服务器控件属性中使用ASP.NET <%=标签?
- 没有aspx文件扩展名的ASP.NET网页
- asp.net-mvc – 静态文件请求正在ASP.NET MVC3中
- asp.net-mvc – ‘/’应用程序中的ASP.NET MVC3
热点阅读