工具提示在网格图像按钮内不起作用 [英] Tooltip is not working inside grid image button
本文介绍了工具提示在网格图像按钮内不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请参阅以下代码并解决工具提示无效的原因
Hi,
Please see following code and resolve why tooltip is not working
<ItemTemplate>
<table>
<tr>
<td>
<asp:ImageButton ID="lbtnSendMail" runat="server" CommandArgument='<%# Eval("Id")%>'
CommandName="Send Mail" ImageUrl="~/App_Themes/Resource/images/email_icon.gif" Height="20px" Width="20px" ToolTip="Send Mail"/>
</td>
<td>
<asp:ImageButton ID="ibtnDelete" runat="server" CommandName="Del" CommandArgument='<%# Eval("Id")%>' ImageUrl="~/App_Themes/Resource/images/delete_icon.gif" ToolTip="Delete" OnClientClick="return confirm('Are you sure you want to delete?');" />
</td>
</table>
</ItemTemplate>
谢谢
Thanks
推荐答案
如果不起作用通过分配html代码,尝试在代码隐藏文件中的RowDataBound事件中分配tooltip属性。检查下面的代码 -
If it does not work by assigning in html code, try to assign tooltip property in RowDataBound event in code behind file. Check the code below-
protected void Gridview1_RowDataBound(object sender, GridViewRowEventArgs e)
{
ImageButton lbtnSendMail = (ImageButton)e.Row.FindControl("lbtnSendMail");
lbtnSendMail.ToolTip = "Send Mail";
ImageButton ibtnDelete = (ImageButton)e.Row.FindControl("ibtnDelete");
ibtnDelete.ToolTip = "Delete";
}
尝试使用ToolTip指定AlternateText属性。 ToolTip不适用于所有浏览器。
Try specifying AlternateText property along with ToolTip. ToolTip does not work on all browsers.
这篇关于工具提示在网格图像按钮内不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文