根据DropDownList选择将控件添加到窗体 [英] Add controls to form based on DropDownList selection

查看:64
本文介绍了根据DropDownList选择将控件添加到窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.net和c#设计在线表单,我想基于DropDownList选择添加后续的面板数,每个面板将包含两个文本框和另一个DropDownList,然后可以对其进行样式设置并从中获取信息.因此,例如,如果用户选择"5",它将回传并创建5个新面板.

我已经对此进行了广泛的研究,但是我发现的所有答案要么都不完整,要么不胜枚举.

表单本身非常简单,是否有更简单的方法?

I am designing an online form using .net and c#, I would like to add a subsequent number of panels based on a DropDownList selection, each panel will contain two textboxes and another DropDownList which I can then style and obtain the information from. So if the user selects "5" for instance it will postback and create 5 new panels.

I have researched this to a great extent, all of the answers that I found however are either incomplete or over my head.

The form itself is fairly simple, Is there an easier way?

推荐答案

创建javascript函数以设置面板的可见性并在以下事件的"onChange"事件中调用该函数DropDownList.
Create javascript function to set visibility of panels and call that function at ''onChange'' event of DropDownList.


这篇关于根据DropDownList选择将控件添加到窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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