2010-08-27 73 views
0

我在我的web應用程序中使用了很多LinkBut​​tons,其中包含文本和圖像。 所有LinkBut​​ton都設置了一個工具提示,並且LinkBut​​ton中的所有圖像都設置有替代文本。ASP.NET LinkBut​​ton工具提示被圖像替代文本覆蓋

<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> 

的問題是,在Internet Explorer中的圖像的替代文本中示出的代替的LinkBut​​ton的工具提示。在Firefox中這個問題不存在,它總是顯示LinkBut​​ton的工具提示。

這是產生XHTML:

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

是否有可能解決這個問題? 刪除所有備用文本將解決問題,但始終歡迎更好(更標準)的方式!

回答

1

嘗試在圖像上設置空的title屬性。

或者使用<asp:ImageButton />代替<asp:LinkButton />

+0

使用的的伎倆。我需要替換很多LinkBut​​tons,或者刪除alt-attribute。 – thomasvdb 2010-08-27 11:24:10