简体   繁体   English

在c#.net中根据用户选择动态添加控件

[英]Adding controls dynamically on user selection in c#.net

I have a dropdown which consists of all the controls names like textbox , label , combobox , dropdown list...etc. 我有一个下拉列表,其中包含所有控件名称,例如textbox,label,combobox,droplist list等。 if in the starting one label control is placed on form,on user selection of control name in dropdown list ,that label control should be replaced with the user selected control dynamically...like this,what ever control user wants to keep can keep just by selecting dropdow 如果在窗体上放置一个标签控件,则在下拉列表中用户选择控件名称时,该标签控件应动态地替换为用户选择的控件...这样,用户想要保留的控件只能保留通过选择dropdow


i need the controls to be dynamic.that is only the requirement.whenever a person ,say admin want to change the controls from CMS,he can easily change with the selection. 我需要控件是动态的。这仅是必要条件。每当有人说管理员要从CMS更改控件时,他可以随选择轻松更改。

You'll need to use some Javascript magic for this. 您需要为此使用一些Javascript魔术。 Whats the specific requirement? 有什么具体要求?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM