Click here to Skip to main content
16,018,347 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Please see following code and resolve why tooltip is not working

ASP.NET
 <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
Posted

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";
}
 
Share this answer
 
Comments
[no name] 9-Oct-13 2:50am    
Thanks Mam, it worked.
Try specifying AlternateText property along with ToolTip. ToolTip does not work on all browsers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900