Solved

ASP: adding tooltip to  <asp:Literal

Posted on 2014-04-22
4
1,435 Views
Last Modified: 2014-04-22
How do i add a tooltip (or text when i hover over) a title with the below code.

      <td>
            <table style="height: 100%;">
                  <tr>
                        <td class="PageTitle" colspan="2">
                              <asp:Literal ID="lblPageTitle" Text="Main page" runat="server"/>
                        </td>
                  </tr>
            </table>
            <div class="BottomBorder">
                        &nbsp;</div>
      </td>
0
Comment
Question by:badtz7229
  • 2
4 Comments
 
LVL 32

Expert Comment

by:Big Monty
ID: 40015894
The Literal control doesn't have any visual appearance on a Web Form but is used to insert literal text into a Web Form. For example if you examine the HTML dump of a page with the following code in it
<asp:Literal ID="lit1" runat="server">some text</asp:Literal>
you will notice that only the text is rendered on the page - that is why there is no tooltip. If you want to have a tooltip on the text, you need to wrap it in some container - DIV, or P for example,  with the corresponding "title" property.
0
 
LVL 32

Accepted Solution

by:
Big Monty earned 500 total points
ID: 40015899
you could try something like this:

<td>
            <table style="height: 100%;">
                  <tr>
                        <td class="PageTitle" colspan="2">
                              <div title="tooltip text goes here"<asp:Literal ID="lblPageTitle" Text="Main page" runat="server"/></div>
                        </td>
                  </tr>
            </table>
            <div class="BottomBorder">
                        &nbsp;</div>
      </td>

Open in new window

0
 

Author Closing Comment

by:badtz7229
ID: 40016058
thank you . this worked. i also find that changing the tag to a label did the trick


<asp:Label ID="lblPageTitle" Text="Main page" runat="server" ToolTip="tooltip text goes here"></asp:Label>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
asp.net mvc return json 2 56
WKHTMLTOPDF - --disable-smart-shrinking not working 10 36
Resolve Dependency Issues 4 45
Data is not showing from images 15 37
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now