开发者

Adding tooltip for many Images in the same column in a grid. in asp.net

protected void MyGrid_RowDataBound(object sender, GridViewRowEventArgs e)
    {

                    if (value >= lowtarg && value < Toptarg)
                    {
                        img.ImageUrl = "Styles/Images/AmberBox.jpg";
                   开发者_运维知识库 }
                    else if (value >= Toptarg)
                    {
                        img.ImageUrl = "Styles/Images/GreenBox.jpg";
                    }
                    else if (value < lowtarg)
                    {
                        img.ImageUrl = "Styles/Images/RedBox.jpg";
                    }

          }

I am doing this in server side and displaying the images in the grid view,

                       <asp:TemplateField HeaderText="Status">
                        <ItemTemplate>
                        <asp:ImageButton ID="Status" runat="server" />

                        </ItemTemplate>

This is the column in the grid view I am displaying the images. How can I add tool tip for each image.


I would use the ImageButton's AlternateText property.

From the MSDN doc:

Browsers that support the ToolTips feature display this text as a ToolTip.

(You'll need to specify what content you want to have in the Tooltip and where it comes from if you need more detail...)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜