如何使用c#在asp.net中运行时创建按钮和事件 [英] how to create button and event at runtime in asp.net using c#

查看:79
本文介绍了如何使用c#在asp.net中运行时创建按钮和事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行时在asp.net中使用c#

how to create button and event at runtime in asp.net using c#

推荐答案

创建按钮和事件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[^]


这篇关于如何使用c#在asp.net中运行时创建按钮和事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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