How to change the button to an imagebutton in the SearchBox.ascx

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 năm cách đây
Hi,

When I change the asp:button in the searchbox.ascx to an asp:imagebutton I get this error:

The base class includes the field 'btnSearch', but its type (System.Web.UI.WebControls.Button) is not compatible with the type of control (System.Web.UI.WebControls.ImageButton).

What is the way to handle this issue?
13 năm cách đây
Just recompile the solution
13 năm cách đây
Thanks Andrei for responding, but the site will not compile because of this error...
13 năm cách đây
Have you changed it in Visual Studio? If not, then go to searchbox.ascx.designer.cs and replace System.Web.UI.WebControls.Button with System.Web.UI.WebControls.ImageButton for 'btnSearch'
13 năm cách đây
OK, Andrei, I have changed in VS: in the designer.cs to an ImageButton. No luck. I have also tried puttin the declaration in the code-behind file, no luck.

The error is about the base-class:

The base class includes the field 'btnSearch', but its type (System.Web.UI.WebControls.Button) is not compatible with the type of control (System.Web.UI.WebControls.ImageButton).

Any more ideas?
13 năm cách đây
Fabianus wrote:
OK, Andrei, I have changed in VS

Recompile the solution again. It should work
13 năm cách đây
I'm not sure why you want to change it to an imagebutton. You can also change the css class for each button and add à background and remove the borders.
Hope this helps.

Example:
Background: url('images/button.gif') left top;
Border:0;
13 năm cách đây
You are right, why make 3 turns left when one turn right is also ok. Thanks!
11 năm cách đây
if you made all the changes necessary, all you have to do is clean the solution.
SOLVED: under build click clean solution.
the squiggly line should go away after
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.