Brendan Enrick

Daily Software Development

Why the TextBoxWatermark is the Best AJAX Control

bertiebotts-bag-promoThere are plenty of AJAX tools being used everyday. The AJAX Control Toolkit can be likened to a pack of Bertie Bott's Every Flavor Beans; there are far too many choices. Some tools you'll love and some are as useless to you as an earwax flavored bean. Likely no individual developer will find a use for every control in the toolkit, but there is one which I think has a simple use which can be applied to nearly all sites; the TextBoxWatermark control.

When using the TextBoxWatermark control a developer is able to easily place text inside of a TextBox for a user to see. In my experience I've noticed that users tend to read as little text as they can when using forms. It is also difficult sometimes to write necessary information within strict size constraints. Plenty of text boxes require a title on the left so a user know what to type in the box, and then there might be another message below giving more specific instructions.

My personal favorite method for using this control is to place the title of the TextBox to the left and then placing an example in the TextBox as a watermark. This gives the user a nice example which cannot be easily ignored. Overall a very useful control. It is also very simple to use.

<ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
    TargetControlID="TextBox1"
    WatermarkText="YourDomainHere.com"
    WatermarkCssClass="watermark" />
<asp:TextBox ID="TextBox1" runat="server" />

TextBoxWatermark

Using this control it is simple and easy to pass along great information to the user which he or she cannot ignore. It can also make a form look more professional. I am not saying that the TextBoxWatermark is the only useful control. Most of the tools are very useful, but some have some obscure uses. Some of them I know when people use them I just think they shouldn't use them.

Happy AJAXing.

Loading