Converting Search LinkButton to ImageButton doesn't work

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Converting Search LinkButton to ImageButton doesn't work

Post by ZLA » Tue Sep 15, 2009 4:29 pm

In CategorySearchSideBar.ascx, the keyword button is defined as follows:

Code: Select all

<asp:LinkButton ID="KeywordButton" runat="server" Text="Go" CssClass="searchButton" 
SkinId="ignore" EnableViewState="False" />
Our design uses an image instead of a formatted link so I tried the following:

Code: Select all

<asp:ImageButton ID="KeywordButton" runat="server" Text="Go" CssClass="searchButton"
SkinId="ignore" EnableViewState="False" 
ImageUrl="~/App_Themes/StorkGiftsBrown/images/pink-go-button.jpg" 
/>
When I do this, the page posts back but nothing happens. This is because on postback, the Imagebutton produces an empty value for eventTarget in PageInit routine. So NarrowByKeyword never gets called. I also tried it with EnableViewState="True" but that made no difference either.

Can someone tell me what I'm doing wrong? Changing linkbuttons to imagebuttons elsewhere worked fine. It's just on this page that it seems to fail. Thanks in advance.

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: Converting Search LinkButton to ImageButton doesn't work

Post by ZLA » Tue Sep 15, 2009 5:16 pm

Realized other conversions used explicit OnClick event whereas this control doesn't. So I did the following instead which worked fine:

Code: Select all

<asp:LinkButton ID="KeywordButton" runat="server" Text="" CssClass="searchButton" SkinId="ignore" 
      EnableViewState="False" >
   <img id="KeywordButtonImage" runat="server" 
      src="~/App_Themes/StorkGiftsBrown/images/pink-go-button.jpg" />
</asp:LinkButton>

Post Reply