Thursday, 26 June 2014

jQueryUI Tooltip Using jQuery on Textbox MouseOver in Asp.Net

6/26/2014 - By Pranav Singh 0

In this article I will show you how you can display tooltip on a textbox on mouse over using jquery in asp.net. In this article I have used asp.net,jquery, jqueryui for displaying tooltip.


So for this article first we will create and asp.net application and add the below code in you aspx page.


<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true"  CodeBehind="Default.aspx.cs" Inherits="Asp.Net_ToolTip._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head id="Head1" runat="server">
    <title>jQueryUI   Tooltip Using jQuery on Textbox in Asp.Net</title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <script>
      $(function () {
          $(document).tooltip({
              position: {
                  my: "left",
                  at: "right",
                  using: function (position, feedback) {
                      $(this).css(position);
                      $("<div>")
            .addClass("arrow")
            .addClass(feedback.vertical)
            .addClass(feedback.horizontal)
            .appendTo(this);
                  }
              }
          });
      });
  </script>
 </head>
<body>
    <form id="Form1" runat="server">
    <div class="page">
        <div class="header">
            <div class="title">
                <h1>
                    ASP.NET ToolTip
                </h1>
            </div>
           
            <div class="clear hideSkiplink">
               
            </div>
        </div>
        <div class="main">          
            Enter Name :
            <p><asp:TextBox ID="TextBox1" runat="server" Width="200px" title="Please enter you name."> </asp:TextBox></p>          
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="footer">
       
    </div>
    </form>
</body>
</html>

In above code jquery script is used for displaying the tooltip on textbox. In this the text which you will provide as a title will display as  tooltip text.

<script>
      $(function () {
          $(document).tooltip({
              position: {
                  my: "left",
                  at: "right",
                  using: function (position, feedback) {
                      $(this).css(position);
                      $("<div>")
            .addClass("arrow")
            .addClass(feedback.vertical)
            .addClass(feedback.horizontal)
            .appendTo(this);
                  }
              }
          });
      });
  </script>

Now run the page to check the output.



DOWNLOAD

About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top