Solved

ASP: adding tooltip to  <asp:Literal

Posted on 2014-04-22
4
1,569 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 33

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 33

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

690 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