如何在运行时将控件添加到UpdatePanel [英] How do I add Controls to an UpdatePanel at runtime

查看:78
本文介绍了如何在运行时将控件添加到UpdatePanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建网络表单.表格上的一部分要求用户输入至少一个2位元的信息.为此,首先为他们提供1个数据绑定控件和一个非绑定控件(下拉列表和一个文本框),以便他们填写信息.

我的问题是他们可能想输入更多信息,所以我想出了一个按钮,他们可以单击一次以将两个控件(下拉列表和文本框)添加到他们已经填写的两个控件的下面.网络表单.我已经将控件放置在一个updatepanel中,但接下来的工作我几乎陷入了困境.谁能给我一些下一步的建议?

I''m trying to build a web form. A section on the form requires that a user enters at least one 2-tuple bit of information. To do this they are presented at first with 1 data bound control and one non bound control(drop down list and a text box) for them to fill in the information.

My problem is that they may want to enter more information so i came up with a button which they can click on once to add the two controls(drop down list and a text box) just under the two they''ve already filled on the web form. I''ve placed the controls in an updatepanel but I''m pretty much stuck in what to do next. Can anyone give me some pointers on what to do next?

推荐答案

默认情况下隐藏第二个控件,然后单击按钮时使用JavaScript来显示它们.不需要服务器调用,也不需要更新面板.
Hide the second controls by default then when clicking the button use JavaScript to show them. There is no need for a server call, and no need for an update panel.


这篇关于如何在运行时将控件添加到UpdatePanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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