Solved

ASP: adding tooltip to  <asp:Literal

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IIS redirect 1 67
C# Desktop Application 3 29
asp enable view state 1 24
Client Validating 2 date fields, required & comparison 1 22
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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 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