asp.net – Ajax Control Toolkit正在加载太多脚本资源
发布时间:2020-05-22 21:33:12 所属栏目:asp.Net 来源:互联网
导读:我创建了一个新项目.我从NuGet安装了Ajax Control Toolkit.然后我用以下代码创建了一个新页面aspx: html xmlns=http://www.w3.org/1999/xhtmlhead runat=server title/title/headbody form id=form1 runat=server
|
我创建了一个新项目.我从NuGet安装了Ajax Control Toolkit.然后我用以下代码创建了一个新页面aspx: <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ajaxToolkit:ToolkitScriptManager ID="toolkitScriptMaster" runat="server">
</ajaxToolkit:ToolkitScriptManager>
hello!!!!
</div>
</form>
</body>
</html>
当我看到ajaxtookit创建了152个脚本资源文件时,我感到很沮丧. 是正常吗 我能做什么? 解决方法CodePlex的AjaxControlToolkit版本2013年7月 introducing control bundles.默认情况下,AjaxControlToolkit加载所有脚本.因此,要管理哪些脚本应该添加和分组的控件,您需要将AjaxControlToolkit.config添加到Web应用程序项目的根目录.就像下面的例子一样: <ajaxControlToolkit>
<controlBundles>
<controlBundle>
<control name="CalendarExtender" />
<control name="ComboBox" />
</controlBundle>
<controlBundle name="CalendarBundle">
<control name="CalendarExtender"></control>
</controlBundle>
</controlBundles>
</ajaxControlToolkit>
那么您将需要指定哪些页面将使用哪些页面(或者如果您有所有页面上使用的控件的主页面),请通过向Toolkit脚本管理器控件添加特定名称的捆绑包: <ajaxToolkit:ToolkitScriptManager runat="server" CombineScripts="true"
ScriptMode="Release" >
<ControlBundles>
<ajaxToolkit:ControlBundle Name="Calendar" />
</ControlBundles>
</ajaxToolkit:ToolkitScriptManager>
备注:here可以找到包含最多的配置示例(也可以从ajax控件工具包库中的所有控件的定义). (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 从ASP.NET切换到面包和黄油HTML / jQuery的优势
- asp.net-mvc-4 – 如何将自定义css / js添加到MVC4项目进行
- asp.net-mvc – 在ASP.NET MVC中以HTML格式呈现RDLC报告
- 如何格式化带有class参数的asp.net webmethod的JSON
- 用于诊断.NET中的内存泄漏的工具(ASP.NET应用程序)
- asp.net-mvc – 使用ASP.NET会员资格和配置文件与MVC,如何创
- asp.net-mvc – 在asp.net mvc中的视图中设置页面标题,元信
- Asp.Net MVC EnableClientValidation不起作用
- asp.net-core – 如何从ASP.NET Core中的Razor View获取Url
- asp.net CustomValidator从不触发OnServerValidate
推荐文章
站长推荐
- asp.net-mvc – 使用MVC将数据导入局部视图或布局
- asp.net – System.Web.Security.AntiXss.AntiXs
- asp.net-mvc-4 – 如何通过ASP.NET MVC中的Simpl
- asp.net-mvc – 在ASP.Net MVC中使用System.Guid
- asp.net-mvc – Asp.net MVC 3 RC – Razor Vali
- asp经典 – 如何获得经典ASP中的当前域?
- asp.net mvc使用html5mode和路由托管角度应用程序
- 在mvc4 asp.net中的Razor View中的模型声明
- asp.net – 来自web.config的Asp .Net自定义成员
- asp.net-web-api – 如何从Web API响应中删除标头
热点阅读
