ajaxcontroltoolkit 的 Ajax CDN 支持
我在我的 Web 表单应用程序中使用 ajaxcontroltoolkit。我在我的母版页中添加了 ToolkitScriptManager,如下所示;
<ajaxToolkit:ToolkitScriptManager runat="server" />
并生成以下几行;
<script src="/WebResource.axd?d=Jibl3MtI-Z0SnbWFojUORizoN9Crh5ry8NMfzJSSnoTf-UFTKFjMJ64T1LoJzsMiy-3x84ZOv4fPul5Ovf0hWqKfvas1&t=634361805716190000" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=GaKMM7fT3pJ-STBLsG7RA9G19YL8-8Qwn55cEa789OnUZnJVo7k-lHiGlv-78SX_-jNa1e8ggtiMU1q11qL5p_Ds-x2fGN94tSQ_LiVmXw5rZT5JLvwPijiZtGc4sjeI6qyDWl6iPDaSvOI5BxUFSYMrocQ1&t=ffffffff88dd8486" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=5-e4xi7M2z7nkjzlbU8-TWOpW3pG-5yWTc1gjU27ASzLUO3z3X6ekk3Sni1yPjhQTHZqsYZzKxrYCi_Gka_qck67rCoY74phG4J0hnrafob5PPfGsqMiXsHm5iwUWoAf11fyGw2&t=11e6618b" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=QuFbQ1DExlSpNLIb-yKHF9rpmtXEsaZy3mY1kUywoGagqJwlk39ehRy6UMfloAvfPq5iKspCQd3hr6z2WtLRfs2vX5cK8IhsLTmXS2C608YECG519GPA63CN6_5IYjb9Or0HIg2&t=11e6618b" type="text/javascript"></script>
<script src="/default.aspx?_TSM_HiddenField_=ctl08_HiddenField&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d3.5.40412.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-GB%3a1547e793-5b7e-48fe-8490-03a375b13a33%3ade1feab2%3af9cec9bc%3aca57ef3c%3aab09e3fe" type="text/javascript"></script>
<script type="text/javascript">
有什么方法可以通过 Ajax CDN 为它们提供服务吗?我在 .net 4。谢谢!
编辑: 这是我添加 EnableCdn 属性后的样子;
<script src="http://ajax.microsoft.com/ajax/4.0/1/WebForms.js" type="text/javascript"></script>
<script src="http://ajax.microsoft.com/ajax/4.0/1/WebUIValidation.js" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=5-e4xi7M2z7nkjzlbU8-TWOpW3pG-5yWTc1gjU27ASzLUO3z3X6ekk3Sni1yPjhQTHZqsYZzKxrYCi_Gka_qck67rCoY74phG4J0hnrafob5PPfGsqMiXsHm5iwUWoAf11fyGw2&t=ffffffffbd2983fc" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=QuFbQ1DExlSpNLIb-yKHF9rpmtXEsaZy3mY1kUywoGagqJwlk39ehRy6UMfloAvfPq5iKspCQd3hr6z2WtLRfs2vX5cK8IhsLTmXS2C608YECG519GPA63CN6_5IYjb9Or0HIg2&t=ffffffffbd2983fc" type="text/javascript"></script>
<script src="/default.aspx?_TSM_HiddenField_=ctl08_HiddenField&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.40412.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-GB%3aacfc7575-cdee-46af-964f-5d85d9cdcf92%3ade1feab2%3af9cec9bc%3aca57ef3c%3aab09e3fe" type="text/javascript"></script>
<script type="text/javascript">
I am using ajaxcontroltoolkit in my web forms application. I have added ToolkitScriptManager in my master page like below;
<ajaxToolkit:ToolkitScriptManager runat="server" />
and the following lines are generated;
<script src="/WebResource.axd?d=Jibl3MtI-Z0SnbWFojUORizoN9Crh5ry8NMfzJSSnoTf-UFTKFjMJ64T1LoJzsMiy-3x84ZOv4fPul5Ovf0hWqKfvas1&t=634361805716190000" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=GaKMM7fT3pJ-STBLsG7RA9G19YL8-8Qwn55cEa789OnUZnJVo7k-lHiGlv-78SX_-jNa1e8ggtiMU1q11qL5p_Ds-x2fGN94tSQ_LiVmXw5rZT5JLvwPijiZtGc4sjeI6qyDWl6iPDaSvOI5BxUFSYMrocQ1&t=ffffffff88dd8486" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=5-e4xi7M2z7nkjzlbU8-TWOpW3pG-5yWTc1gjU27ASzLUO3z3X6ekk3Sni1yPjhQTHZqsYZzKxrYCi_Gka_qck67rCoY74phG4J0hnrafob5PPfGsqMiXsHm5iwUWoAf11fyGw2&t=11e6618b" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=QuFbQ1DExlSpNLIb-yKHF9rpmtXEsaZy3mY1kUywoGagqJwlk39ehRy6UMfloAvfPq5iKspCQd3hr6z2WtLRfs2vX5cK8IhsLTmXS2C608YECG519GPA63CN6_5IYjb9Or0HIg2&t=11e6618b" type="text/javascript"></script>
<script src="/default.aspx?_TSM_HiddenField_=ctl08_HiddenField&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d3.5.40412.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-GB%3a1547e793-5b7e-48fe-8490-03a375b13a33%3ade1feab2%3af9cec9bc%3aca57ef3c%3aab09e3fe" type="text/javascript"></script>
<script type="text/javascript">
Is there any way that I can serve them from Ajax CDN? I am on .net 4. thanks!
EDIT :
here how it looks like after I added EnableCdn property;
<script src="http://ajax.microsoft.com/ajax/4.0/1/WebForms.js" type="text/javascript"></script>
<script src="http://ajax.microsoft.com/ajax/4.0/1/WebUIValidation.js" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=5-e4xi7M2z7nkjzlbU8-TWOpW3pG-5yWTc1gjU27ASzLUO3z3X6ekk3Sni1yPjhQTHZqsYZzKxrYCi_Gka_qck67rCoY74phG4J0hnrafob5PPfGsqMiXsHm5iwUWoAf11fyGw2&t=ffffffffbd2983fc" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=QuFbQ1DExlSpNLIb-yKHF9rpmtXEsaZy3mY1kUywoGagqJwlk39ehRy6UMfloAvfPq5iKspCQd3hr6z2WtLRfs2vX5cK8IhsLTmXS2C608YECG519GPA63CN6_5IYjb9Or0HIg2&t=ffffffffbd2983fc" type="text/javascript"></script>
<script src="/default.aspx?_TSM_HiddenField_=ctl08_HiddenField&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.40412.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-GB%3aacfc7575-cdee-46af-964f-5d85d9cdcf92%3ade1feab2%3af9cec9bc%3aca57ef3c%3aab09e3fe" type="text/javascript"></script>
<script type="text/javascript">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 .NET 4 版本的 Control Toolkit,只需将
EnableCdn
设置为 true:If you're using the .NET 4 version of the Control Toolkit, simply set
EnableCdn
to true:这是不可能的,控制仅指向本地动态文件。
也许更好的想法是将所使用的功能迁移到基于 jquery 的替代方案,并且您可以使用 CDN。
This is not possible, the control points to local dynamic files only.
Maybe a better idea is migrate the functions used, to a jquery based alternative with witch you can use a CDN.