把你的控件声明该一下
比如 protected System.Web.UI.WebControls.Button Button1;
原来是button,现在是imagebutton
就要该为 protected System.Web.UI.WebControls.ImageButton ImageButton1;
比如 protected System.Web.UI.WebControls.Button Button1;
原来是button,现在是imagebutton
就要该为 protected System.Web.UI.WebControls.ImageButton ImageButton1;
所以cs文件中有了button的定义 ,如 protected System.Web.UI.WebControls.Button Button1而现在你把button改称了image ,但是cs文件中的定义还是button所以会报错
你应该把原先定义button的部分修改成protected System.Web.UI.WebControls.ImageButton ImageButton1;
然后重新编译即可