ASP.NET: Tooltip in Datalist

In this article I explain how to add a tooltip. Here I provide an example to show a tooltip on the profile images. Like in the following image :


First I bound a datalist from a database containing the details of users. I bound two fields, name and image, image is only for displaying in the datalist and name is to be shown in the tooltip.

Use the following procedure:

  1. Add the plugin jquery.tooltip. You can download it.
  2. Write the following code in the aspx page:



    <title>Show Gridview Rows Details in tooltip with jQuery</title>


    <%--<script src="jquery.tooltip.min.js" type="text/javascript"></script>--%>



        function InitializeToolTip() {


                track: true,

                delay: 0,

                showURL: false,

                fade: 100,

                bodyHandler: function () {

                    return $($(this).next().html());


                showURL: false





        $(function () {





    #tooltip {









    #tooltiph3,#tooltipdiv { margin:0; }













                            <asp:LabelID="Label1"runat="server"Text='<%# Eval("Name")%>'Visible="false"></asp:Label>

               <ahref="#"><asp:ImageID="Image1"runat="server"ImageUrl='<%# Eval("image_path")%>'Width="50px"Height="50px"CssClass="datalistToolTip"/>




    <td><%# Eval("Name")%></td>














  3. Do not forget to bind a datalist from your database.

    When you are done, save the page and view the page in a browser; it will work perfectly.

    Here when you download the plugin, describe it in the head section as I did just to fetch the information of the tooltip on mouse hover.

    When you are done with the declarations in the head section in the aspx page and bind the datalist, add a table to the datalist item template field so that the tooltip can show the data you want. For example I added a div with the id "tooltip"; see:

    td><%# Eval("Name")%></td>

So, on mouse hover this div will show you the data that you want.