我在我的网络表单应用程序中使用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">
答案 0 :(得分:1)
这是不可能的,控件仅指向本地动态文件。 也许更好的想法是将所使用的函数迁移到基于jquery的替代方案,并且可以使用CDN。
答案 1 :(得分:1)
如果您使用的是.NET 4版本的Control Toolkit,只需将EnableCdn
设置为true:
<ajaxToolkit:ToolkitScriptManager runat="server" EnableCdn="true" />