把你的控件声明该一下
比如        protected System.Web.UI.WebControls.Button Button1;
原来是button,现在是imagebutton
就要该为    protected System.Web.UI.WebControls.ImageButton ImageButton1;