views:

8

answers:

1

I'm using a lot of LinkButtons in my web application with text and images inside them. All LinkButtons are set with a ToolTip and all images inside the LinkButtons are set with an alternate text.

<asp:LinkButton CssClass="button button-input" ID="btnSearch" runat="server" CausesValidation="False" ToolTip="Search"> 
    <img id="imgSearch" runat="server" src="../../../images/icons/magnifier-left.png" alt="search-something" width="12" height="12" />
</asp:LinkButton> 

The problem is that in Internet Explorer the alternate text of the image is shown instead of the ToolTip of the LinkButton. In Firefox this problem doesn't exists, it always show the ToolTip of the LinkButton.

This is the produced XHTML:

<a href="javascript:__doPostBack('...','')" title="Search" id="..."><img width="12" height="12" alt="search-something" id="..." src="../../images/icons/magnifier-left.png"></a>

Is it possible to overcome this issue? Removing all alternate texts will resolve the issue but a better (more standard) way is always welcome!

+1  A: 

Try to set a empty title attribute on your image.

Or use <asp:ImageButton /> instead of the <asp:LinkButton />

BrunoLM
Using <asp:ImageButton /> did the trick. Will need to replace a lot if LinkButtons I guess... or remove the alt-attribute.
thomasvdb