Using DIV+CSS to create customizable tooltip styles in the GridView template column

Source: Internet
Author: User
In a project, we often encounter situations where we need to look at the details of all the fields in a datasheet, we usually display some of the necessary fields such as IDs, and then put the other fields together on DetailView or another page, and then provide a LinkButton for "view details." Or use a script to eject another web window. These practices are slightly lame, if only for "view Details" and view the details (amount, some clumsy), we have a better solution, using DIV+CSS to achieve similar ToolTip effect.
As we all know, some HTML elements or ASP.net controls have a property called ToolTip. This property is mainly to display some hints and descriptive information when the mouse is moved. Unfortunately, it cannot embed HTML code like the innerHTML attribute. Like what: <asp:image id= "Image1" imageurl= "~/images/more.gif" tooltip= "<b> earthquake relief Concerted effort </b>" runat= "Server"/ >
<asp:label id= "Label2" runat= "Server" text= "<b> earthquake relief Concerted effort </b>" ></asp:Label>

Operation Effect as shown:
     
Did not achieve the effect we expected, OK, below we use DIV+CSS to achieve the desired effect within the GridView template.
First, we add a data source control.
        <asp:sqldatasource
            id= "SqlDataSource1"
            runat= "Server"
            ConnectionString= "<%$ Connectionstrings:mysqlconnectionstring%> "
             providername= "System.Data.SqlClient"
     &n
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.