0

I am trying to use bootstrap tooltip in asp.net but it does not work and i am not sure what am I doing wrong here.

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">    
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
     <link href="Content/bootstrap.css" rel="stylesheet" />    
     <script src="Scripts/jquery-2.1.3.min.js"></script>
    <script src="Scripts/bootstrap.min.js"></script>          
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <br />
    <br />
    <br />
     <form id="form1" runat="server">    
         <br />
         <br />
         <asp:TextBox ID="TextBox1" data-toggle="tooltip" data-placement="right"  
                                                  runat="server"></asp:TextBox>    
         <script>
             $(document).ready(function () {
                 $('[data-toggle="tooltip"]').tooltip();
             });
        </script>           
    </form>    
</asp:Content>

1 Answer 1

2

You could be missing a reference like this one depending on which Bootstrap version are you using, if you are using 3.x then you are missing this

<link href="CSS/bootstrap-theme.min.css" rel="stylesheet">

also you are missing the ToolTip attribute in your TextBox1 control

<asp:TextBox ID="TextBox1" data-toggle="tooltip" data-placement="right" ToolTip="My tooltip text" runat="server" />
Sign up to request clarification or add additional context in comments.

3 Comments

is there a way to make the tooltip to appear only on a onclick event?
Change it to a bootstrap popover. Don't forget to mark this as answered.
Yes: data-trigger="click". Read the docs: getbootstrap.com/javascript/#tooltips-options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.