且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用c#在asp.net中运行时创建按钮和事件

更新时间:2022-11-09 11:34:50

创建按钮和事件Vrey非常容易我的朋友!



看看这个简单的例子:



Vrey very easy my firend!

look at this simple example:

 Button button=new Button();
 button.Click += new EventHandler(button_Click);



 void button_Click(object sender, EventArgs e)
 {
// throw new NotImplementedException();
 }



您可以获得更多信息:



ASP.NET中动态创建的控件 [ ^ ]



http://msdn.microsoft.com/en-us/library/ kyt0fzt1(VS.100).aspx [ ^ ]





http://forums.asp.net/t/1505141 .aspx [ ^ ]


you can get more information:

Dynamically Created Controls in ASP.NET[^]

http://msdn.microsoft.com/en-us/library/kyt0fzt1(VS.100).aspx[^]


http://forums.asp.net/t/1505141.aspx[^]