0

my textbox which has a calendarextender attached to it behaves inconsistently. Most of the time, after selecting a date and submitting the form, the textbox does not have a Text value (i checked using quick watch). After rebuilding (without touching anything) it works as it is supposed to be. but after navigating through the site and and returning to the page, sometimes it works, sometimes it does not.

1 Answer 1

0

You need to set the CalendarExtender's selection on your last chance in the page cycle:

    void Page_PreRender(Object sender, EventArgs e)
    {
        if (dateFromAnotherPage != null)
        {
            CalendarExtender1.SelectedDate = DateTime.Parse(dateFromAnotherPage);
        }
    }

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.