0

strange bug:

i have an ajax datepicker added to a text box of my form.

i submit the form.. and I could receive all values excepting those of the datepicker checkboxes.

why is the .Text property empty of this elements?

Thanks

2 Answers 2

3

Is your TextBox disabled for user input, so that it might only be changed by javascript, by the datepicker?

The problem in that case, is that .NET "knows" that the control is disabled, and just assumes that the value cannot, then, have changed since it was rendered. So .NET will use the ViewStated value immediately, without checking the POST data.

There are two solutions to this:

  1. Don't render the TextBox as disabled, but disable it with the datepicker script

  2. Instead of relying on the TextBox's Text property, check Request.Form[myTextBox.ClientID]

Sign up to request clarification or add additional context in comments.

1 Comment

yes it's disabled by javascript :) but it needs to. i try your second solution
0

Try accessing SelectedDate instead of Text.

2 Comments

it's a textbox which hasn't a SelectedDate property :(
Oh sorry, I was referring to a DatePicker control.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.