TextBoxWatermark is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control to get watermark behavior. When a watermarked TextBox is empty, it displays a message to the user. Once the user has typed some text into the TextBox, the watermarked appearance disappears.
TextBoxWatermark Properties:
•TargetControlID - The ID of the TextBox to operate on
•Watermark Text - The text to show when the control has no value
Code:
<%-- ScriptManager control manages client script for AJAX enabled ASP.NET pages.This enables partial-page rendering and Web-service calls.You have to used this if you want to use ajax control toolkit--%>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<%--Add the TextWatermarkExtender here --%>
<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" TargetControlID="TextBox1"WatermarkCssClass="TextWatermarkCss" WatermarkText="Enter Your Name"></cc1:TextBoxWatermarkExtender>
<%--Add the one textbox here --%>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
Add the css in head tag on aspx page
<head><style>
.TextWatermarkCss
{
color: Gray;
font-style: italic;
font-family: Calibri;
}
</style></head>
Run the project
When you click in the text then watermark text will disappear.
Sanju Thakur
22-Aug-2018when page load textbox watermark will dissapear which will not happen ?,so how to solve this problem can you explain sir,