Home > DeveloperSection > Articles > ASP.Net AJAX Server Control: TextBoxWatermarkExtender

ASP.Net AJAX Server Control: TextBoxWatermarkExtender


AJAX AJAX 
Ratings:
0 Comment(s)
 8149  View(s)
Rate this:

ASP.Net AJAX Server Control: TextBoxWatermarkExtender

TextBoxWaterMarkExtender:

This control allows you to put instructions in the textbox control. This gives them a better understanding of what to use the control for. It control have main properties as TargetControlID, WatermarkText, WatermarkCssClass etc.

How we implement the TextBoxWaterMarkExtender

 

Example:

Step1: we use the following control on aspx page

 

<head runat="server">

    <title>TextBoxWatermarkExtender</title>

    <style>

    .TextWatermarkCss

    {

      color:Gray;

      font-style:italic;

      font-family:Calibri;

    }

    </style>

</head>

<body>

<form id="form1" runat="server">

<div>

<%--Using ScriptManager or ToolkitScriptManager according toolkit version--%>

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<%-- add the TextBoxWatermarkExtender and textbox--%>

<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"

TargetControlID="TextBox1" WatermarkText="Enter Text Here" WatermarkCssClass="TextWatermarkCss">

</cc1:TextBoxWatermarkExtender>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

</div>

</form>

</body>

 

Step3: Run the project

Output:

 

 


Don't want to miss updates? Please click the below button!

Follow MindStick