asp.net - How to show tool tip on a Button

Show tool tip in Button control
Button is an asp.net web server control. Button server control display a push button on web page. button server control have a default property to display button tool tip on web page. button's ToolTip property allow us to get or set the text displayed when the mouse pointer hovers over the button server control.

ToolTip property value data type is System.String. ToolTip property default value is String.Empty. String value specify the text displayed when mouse pointer hovers over the button control. tool tip allow us to provide extra information or instruction about the specific server control.

the following asp.net c# example code demonstrate us how can we show tool tip on button server control in a web page.
ButtonToolTip.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to show tool tip (ToolTip) in Button control</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Navy">Button Example: ToolTip</h2>
        <asp:Button 
             ID="Button1" 
             runat="server" 
             Text="Login Button"
             ForeColor="Crimson"
             Font-Bold="true"
             Height="45"
             ToolTip="Click for Login"
             />
        <asp:Button 
             ID="Button2" 
             runat="server" 
             Text="Logout Button"
             ForeColor="Crimson"
             Height="45"
             Font-Bold="true"
             ToolTip="Click for Logout"
             />
    </div>
    </form>
</body>
</html>








Related asp.net example