通过JavaScript添加asp.net服务器端控件动态 [英] Adding asp.net server side controls through javascript dynamically
问题描述
有没有一种方法来在网页上动态添加asp.net服务器端控件,而不会引起回发。就像我可以点击一个按钮动态添加日历控制和处理日历事件,做一些其他的工作......
Is there a way to add asp.net server side control dynamically on the webpage without causing postback. Like can I add a calender control dynamically on a button click and handle calender events to do some other work....
感谢
推荐答案
有没有办法做,没有回发到服务器。然而,回发不必是侵入性:例如,你可以使用的的UpdatePanel 控制执行部分回发,只有更新面板的内容。
There's no way to do that without posting back to the server. However, postbacks don't have to be intrusive: for instance, you might use an UpdatePanel control to perform a partial postback that only updates the panel's contents.
又见 DynamicPopulate 扩展的<一个提供HREF =http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Default.aspx相对=nofollow> AJAX控件工具包,好实现你想要达到的目标。
See also the DynamicPopulate extender provided by the AJAX Control Toolkit, a good implementation of what you want to achieve.
这篇关于通过JavaScript添加asp.net服务器端控件动态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!