---
title: "Ajax Toolkit TextBoxWatermarkExtender Control in ASP.Net"  
description: "TextBoxWatermark is an ASP.NET AJAX extender that can be attached to an ASP.NET TextBox control to get watermark behavior. When a watermarked TextBo"  
author: "Pushpendra Singh"  
published: 2010-12-03  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/283/ajax-toolkit-textboxwatermarkextender-control-in-asp-dot-net  
category: "ajax"  
tags: ["ajax"]  
reading_time: 1 minute  

---

# Ajax Toolkit TextBoxWatermarkExtender Control in ASP.Net

\

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](https://yourviews.mindstick.com/view/83591/the-complete-guide-page-speed-optimisation-and-seo)

```
<head><style> .TextWatermarkCss{      color: Gray;      font-style: italic;      font-family: Calibri;}</style></head>
```

## Run the project

![AjaxControl Toolkit TextBoxWatermarkExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/263a6d0b-7988-4dc2-b041-4883356815e9/images/a0946986-ebba-46cd-b32f-e229075e0556.png)

When you click in the text then watermark text will disappear.

![AjaxControl Toolkit TextBoxWatermarkExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/263a6d0b-7988-4dc2-b041-4883356815e9/images/f32a1c76-e008-46e1-af19-c9d4dd9768f6.png)

---

Original Source: https://www.mindstick.com/articles/283/ajax-toolkit-textboxwatermarkextender-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
