Asp.net 3.5动态控件 [英] Asp.net 3.5 Dynamic Controls
本文介绍了Asp.net 3.5动态控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何机构都知道如何把动态控制在asp.net 3.5?
如果有的话,请例如提供给我。
另外一个问题:是否有可能为动态控件创建事件。
Any body have idea how to put controls dynamically in asp.net 3.5 ? if any example please provide to me. another Question : is it possible to create Event for Dynamic Controls ?
推荐答案
下面是(包括创建一个事件),用于ASP.NET动态控件...一个例子
Here is an example (including creating an event) for ASP.NET dynamic controls...
protected void Page_Load(object sender, EventArgs e)
{
Button button = new Button();
button.Text = "Click me";
button.Click += new EventHandler(ButtonClick);
this.Form.Controls.Add(button);
}
private void ButtonClick(object sender, EventArgs e)
{
(sender as Button).Text = "You just clicked me!";
}
希望它帮助!
这篇关于Asp.net 3.5动态控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文