InitializeComponent()
加入
this.控件ID.Click+= new System.EventHandler(要执行的过程);

解决方案 »

  1.   

    使用Attributes属性增加,例如:
    btn_Del.Attributes["onClick"] = "javascript:return confirm('确定要删除吗?');";
      

  2.   

    直接在设计界面双击该button,自动就切换到 button_onclick事件对应的方法上,而且该方法已经被自动订阅了,你直接写代码就可以了。
      

  3.   

    写一事件xxx,然后在button的OnClick="xxxx"
      

  4.   

    这个要看你使用的是服务器控件还是HTML控件
    如果是服务器控件,你只要双击该控件就可以了
    如果是HTML控件,你就要设定它的OnClick事件
    <input textbox id="textbox1" OnClick="clickhere">在javascript或vbscript中加事件
    function clickhere
    {
    函数体;
    }
      

  5.   

    http://lucky_elove.www1.dotnetplayground.com/
      

  6.   

    如果你的button是html控件。
    那么写click 事件
    <input textbox id="textbox1" OnClick="clickme">
    如果是服务端控件。那么双击button.写它的click 事件。