Saturday 1 September 2012

Beginning .Net : Set Tool Tip for Asp.net Controls

Tool Tip is very useful part of the any application. Tool tips provide more details of particular object on application. Means if there is textbox like "Product name", so you understand that you insert product name in this textbox, But you can specify tool tip on that for end user to give more details on this.

Tool tip appear when you cursor over that particular object.
We can set tool tip using "ToolTip" property of asp.net controls.

Here is example for this.
In this example we set tool tip on textbox , button and file upload control. Almost all asp.net controls has "ToolTip" property. In output you can see that when mouse cursor is stay over the "Save" button at that time Tool Tip "Click to save product details." is appear.

ASPX Code :
        <table>
            <tr>
                <td>
                    Product Title :
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtProductTitle" ToolTip="Enter Product Name."   ></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Product Document :
                </td>
                <td>
                    <asp:FileUpload runat="server" ID="fuDocument" ToolTip="Select file to upload."  />
                </td>
            </tr>
        </table>
        <asp:Button runat="server" ID="btnSave"  Text="Save" onclick="btnSave_Click" ToolTip="Click to save prduct details." />

Output :

This is very useful articles for Beginning .Net .

This type of C# Tips is very useful in day to day programming life.

Note : Give Us your valuable feedback in comments. Give your suggestions in this article so we can update our articles accordingly that.



No comments:

Post a Comment