views:

1879

answers:

5

I have a database that contains a date and we are using the MaskedEditExtender (MEE) and MaskedEditValidator to make sure the dates are appropriate. However, we want the Admins to be able to go in and change the data (specifically the date) if necessary.

How can I have the MEE field pre-populate with the database value when the data is shown on the page? I've tried to use 'bind' in the 'InitialValue' property but it doesn't populate the textbox.

Thanks.

A: 

I believe that is what is happening here but it won't populate.

"<asp:TextBox ID="comEvnt _DateTextBox" runat="server" Text='<%# Bind("comEvnt _Date") %>' />");

Keng
A: 

Are you referring to the asp.Net Ajax toolkit extensions at:

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/MaskedEdit/MaskedEdit.aspx

If so have you checked that your data is coming back in the correct format? It will have to match your date format in order to be displayed.

Keith
A: 

Are you referring to the asp.Net Ajax toolkit extensions at:

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/MaskedEdit/MaskedEdit.aspx

If so have you checked that your data is coming back in the correct format? It will have >to match your date format in order to be displayed.

Yes, I'm using those. The db field it's pulling is a date/time field that is validated using the same code that is used to enter data into the field (copy/paste).

Keng
+1  A: 

We found out this morning why our code was mishandling the extender. Since the db was handling the date as a date/time it was returning the date in this format 99/99/9999 99:99:99 but we had the extender mask looking for this format 99/99/9999 99:99

Mask="99/99/9999 99:99:99"

the above code fixed the problem. thanks to everyone for their help.

Keng
A: 

link text

If so have you checked that your data is coming back in the correct format? It will have >to match your date format in order to be displayed.

raj