我使用了ajax日历扩展程序,但它显示了一个错误,在页面上需要使用asp.net ajax脚本组件。 [英] I used ajax calender extender but it shows An error scriptManager is required on the page to use asp.net ajax script component.

查看:93
本文介绍了我使用了ajax日历扩展程序,但它显示了一个错误,在页面上需要使用asp.net ajax脚本组件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请解决此问题..我使用了ajax日历扩展程序,但它显示页面上需要一个scriptManager才能使用asp.net ajax脚本组件。

please resolve this.. I used ajax calender extender but it shows A scriptManager is required on the page to use asp.net ajax script component.

推荐答案

A脚本管理器使代码隐藏安全地将脚本添加到网页。



页面可以有零个或一个脚本管理器。不止一个会导致错误。它必须在表单内,并且在任何可能使用它的控件之前。



只需将其添加到表单中:



A script manager enables the code-behind to safely add scripts to the web page.

A page can have either zero or one scriptmanager. More than one will cause an error. It must be within the form and before any controls that may use it.

just add this to the form:

<form>
<asp:ScriptManager ID="ScriptManager1"

                               runat="server" />
....

</form>





如果您的控件需要页面上的脚本,这非常有用。您可以添加脚本(.js文件)并为其命名。如果您检查以确保尚未添加脚本,那么您可以在页面上添加许多控件,确保只添加一次所需的脚本。



这就是AJAX Calendar控件的功能。它需要页面上的脚本,所以它使用脚本管理器来管理它们。





有关脚本管理器的更多信息,请点击此处:< br $> b $ b

https ://msdn.microsoft.com/en-us/library/bb398863%28v=vs.140%29.aspx [ ^ ]

(以及网上的许多其他例子)< br $> b $ b



我希望有所帮助。



如果你得到,请告诉我们再次卡住



请记住:页面上只能有1位剧本管理员。



问候

Andy ^ _ ^



It's pretty useful if you have controls that require scripts on the page. You can add scripts (.js files) and give them a name. If you check to make sure that the script hasn't already been added then you can add many controls onto the page, ensuring that the required scripts are added only once.

That is what the AJAX Calendar control does. It requires scripts on the page so it uses the scriptmanager to manage them.


Further reading on the scriptmanager can be found here:

https://msdn.microsoft.com/en-us/library/bb398863%28v=vs.140%29.aspx[^]
(as well as many other examples online)


I hope that helps.

Let us know if you get stuck again

Remember: Only 1 scriptmanager may exist on a page.

Regards
Andy ^_^


这篇关于我使用了ajax日历扩展程序,但它显示了一个错误,在页面上需要使用asp.net ajax脚本组件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆