写控件有这么久,一直没留心一个问题
就是写了一个简单的控件,实现了IPostBackDataHandler接口,在Render中writer打印
日期1:<input type=text name=Date1> 日期2:<input type=text name=Date2> <br><input type=button onclick=\""+Page.GetPostBackEventReference(this)+"\" name="+this.UniqueID+" id="+this.UniqueID+">";
定义了事件 ,public event EventHandler DateChange;
为什么我这样写,可以回送表单,但不会执行LoadPostData方法,也不会执行DateChange事件的处理程序,但是如果把><input type=button onclick=\""+Page.GetPostBackEventReference(this)+"\" name="+this.UniqueID+" id="+this.UniqueID+">";
改成<input type=submit nmae="+this.UniqueID+"" 就可以正常的回送表单并且处理事件处理程序,这是为什么呢?