动态添加控件 [英] Add controls dynamically
问题描述
我需要在按钮点击动态生成的Web表单上添加一个包含用户控件(文本框)+ 2个Gridviews的面板,这些面板包含他们自己的项目模板+对这些控件进行操作的其他验证。因此,每当用户单击添加面板按钮时,将使用上述控件生成一个新面板。
我正在尝试数据列表和转发器的路径但将数据绑定到上述控件正成为一项挑战。我想在此之前调查其他方面以实现这一目标。
任何帮助,链接,建议或指示都将不胜感激?
谢谢,
Vaibhav。
I have a requirement to add a panel containing a user control (textbox) + 2 Gridviews with their own item templates + other validations operating on these controls, on a Web-Form dynamically resulting from a button click. So every time a user clicks a button "Add Panel", a new panel would be generated with the above controls.
I am trying the route of Data Lists and repeaters but binding the data to the above controls is becoming a challenge. I would like to investigate other frontiers to achieve this before going forward.
Any help, links, suggestions or pointers would be appreciated?
Thanks,
Vaibhav.
推荐答案
从这里开始:
如何:以编程方式将控件添加到ASP.NET网页 [ ^ ]
如何:使用Visual C#.NET在ASP.NET中动态创建控件 [ ^ ]
以编程方式添加ASP.NET控件 [ ^ ]
遇到困难时,请回到这里询问详细问题。
Start here:
How to: Add Controls to an ASP.NET Web Page Programmatically[^]
HOW TO: Dynamically Create Controls in ASP.NET by Using Visual C# .NET [^]
Adding ASP.NET Controls Programmatically[^]
When you get stuck, come back here and ask detailed question.
这篇关于动态添加控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!