Solved

ASP: adding tooltip to  <asp:Literal

Posted on 2014-04-22
4
1,394 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

10 Experts available now in Live!

Get 1:1 Help Now