[How Do I:] Use the ASP.NET AJAX TextBoxWatermark Control Extender?

Please install Silverlight or click download to watch video locally.

In this video you will learn how to use the TextBoxWatermark control extender from the ASP.NET AJAX Control Toolkit, which adds new watermark properties to all standard TextBox controls on an ASP.NET page.

Presented by Joe Stagner

Duration: 6 minutes, 5 seconds

Date: 26 January 2007

Watch    Video   |   Download    Video   |   VB Code    C# Code

Video downloads: WMV  |  Zune  |  iPod  |  PSP  |  MPEG-4  |  3GP

Audio downloads: AAC  |  WMA  |  MPEG-4  |  MPEG-3  |  MPEG-2

Comments : 14

Leave a Comment

funluckykitty : On June 06, 2008 2:14 PM said:

Pretty cool.

JFairbanks : On June 19, 2008 11:01 AM said:

I am having a problem where my watermark text is getting stored in my database field when the AJAX update panel is updated.  Do I have to manually check for and strip out this watermark text value on the databinding event for each update?

cv_vikram : On August 06, 2008 1:27 PM said:

It is simple and good....

mariogaleano : On August 08, 2008 12:43 PM said:

how can i write a css class??

brohde : On October 19, 2008 9:06 AM said:

Is it possible to control the text-mode?

It would be sweet to have this watermark "Enter Password" in single-line mode then convert to password mode as the user types.

Excellent video.

hardik_kachhia : On December 24, 2008 1:51 AM said:

calender extender is very useful video for me

djibril_chimere_DIAW : On December 30, 2008 3:08 AM said:

Thanks! Jërëjëf!

xiangxiangu : On January 06, 2009 9:02 PM said:

good video!

kdj : On February 04, 2009 4:28 PM said:

I am longer able to set text box values via javascript when the watermark control is applied to a control. I stepped though the js in VS2008 and the debugger show that the value was updated but the watermark was still there.

Here is the actual js code I am using it returns from the a string array from the server {City,State}.

The "city" text box has a watermark.

function CheckZipCode(txtZipID, txtCityID,ddlStateID ) {

var txtZip = document.getElementById(txtZipID);

var ddlState = document.getElementById(ddlStateID);

var txtCity = document.getElementById(txtCityID);

if (txtZip != null && txtState != null && txtCity != null) {

if (validate.ZipCode(txtZip.value)) {

var objFields = { txtCity: txtCity, txtState: txtState, txtZip: txtZip };

PageMethods.GetZipCodeDate(txtZip.value, CheckZipCodeSuccess, CheckZipCodeFail,objFields)

}

}

}

function CheckZipCodeSuccess(objResult, context, senderName) {

if (objResult!=null) {

forceBlur(context.txtCity);

context.txtCity.focus();

context.txtCity.value = objResult[0];

context.ddlState.value = objResult[1];

}

}

function CheckZipCodeFail() {

}

kdj : On February 04, 2009 4:34 PM said:

Oh Yeah.

forceBlur(context.txtCity); and

context.txtCity.focus();

I left that in there on accident. That was my way of trying to get around the problem but it does not work.

kdj : On February 04, 2009 4:48 PM said:

I should read things I write before I post. There are typos is the code above I know. Here is a better example:

var MyTextBox = document.getElementById("<%= MyTextBox.ClientID %>");

MyTextBox.value = "text box value updated via javascript!";

this changes the watermark but when focused on it is deleted and reset.

xjjxsz : On April 04, 2009 6:59 AM said:

Why? I can't see anything!~

joseluis2411 : On April 08, 2009 5:26 PM said:

very nice..

sasiatia : On May 14, 2009 5:45 PM said:

same q. as "brohde"

Is it possible to control the text-mode?

It would be sweet to have this watermark "Enter Password" in single-line mode then convert to password mode as the user types.

Excellent video.

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities