Saturday, June 7, 2008

Ajax .Net IV : TextBoxWaterMarkExtender Control

For better look and feel you have to use CSS. But I will avoiding CSS to concentrate on the functionality of controls.


Ajax .Net TextBoxWaterMarkExtender Control is a simple control that extends Asp .Net Input controls.

Here is TextBoxWaterMarkExtender in action.















Here a text will appear inside the control, where you can specify extra information about the control. As you type inside the control the information text will vanish. In the figure above the information text of Name TextBox vanishes as I type my name inside the TextBox.

Start a new Asp .Net Project Place Asp .Net controls as shown in the figure. Add an Ajax .Net TextBoxWaterMarkExtender.
Go to properties window of TextBoxWaterMarkExtender and set TargetControlId to the control to the you want the information message to appear. In this case txtName












Now if the select the properties of TextBox you will see an extra property tab called Extender in this case where you can specify WatermarkText.












This will be the text that will be appearing on the control when the control is blank.

Related Blogs

Ajax .Net I : Extension Controls in Visual Studio 2008

Ajax .Net II : Setting up Ajax Control Toolkit controls

Ajax .Net III : CalendarExtender Control

Ajax .Net V : FilteredTextBoxExtender

No comments:

Post a Comment