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.
Hace 13 años
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?
Hace 13 años
Just recompile the solution
Hace 13 años
Thanks Andrei for responding, but the site will not compile because of this error...
Hace 13 años
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'
Hace 13 años
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?
Hace 13 años
Fabianus wrote:
OK, Andrei, I have changed in VS

Recompile the solution again. It should work
Hace 13 años
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;
Hace 13 años
You are right, why make 3 turns left when one turn right is also ok. Thanks!
Hace 11 años
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.