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:TextBoxID="TextBox1"runat="server"></asp:TextBox>
</div>
</form>
</body>
Step3: Run the project
Output:
Anonymous User
25-Mar-2019Thank You for the post.
Sunil Singh
12-Jul-2017It was really helpful to read this post.