Changing the selecteddate of a calendar control in code

J

Jason James

Hi all,

I use a calendar control in an ASP.NET form that is used to capture the
date of a specific task. I want to be able to show this date at some
future point in time by setting the SelectedDate of the calendar
control to the value returned from a database. This all works fine and
the selected date is indeed highlighted. However, if the date of the
task is not in the current month then I have to navigate to the correct
month of the task to see the highlighted date.

Shouldn't the calendar control change to the correct month and
highlight the selected date before rendering the control? If not then
does anyone have any idea how I can ensure that the calendar control is
showing the correct month for the required task?

Many thanks,

Jason.
 
M

Mark Rae

Shouldn't the calendar control change to the correct month and
highlight the selected date before rendering the control? If not then
does anyone have any idea how I can ensure that the calendar control is
showing the correct month for the required task?

Set the calendar's VisibleDate property first. See MSDN for further details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top