June 10, 2007

Setting SelectedDate of Calendar

While setting the SelectedDate of Calendar control in aspx, please be careful to set to only to Date part of DateTime class. For example,

Calendar1.SelectedDate = DateTime.Now.Date; // this is correct

instead of

Calendar1.SelectedDate = DateTime.Now; // this is wrong

Tankut

5 comments:

Ben Bodien said...

Hi Tankut,

Would it be possible to add a mechanism to your extension of Sortable that allows you to disable the empty place markers for certain Sortable objects?

I have multiple sortables on my application, but not all of them require the empty place markers, and I can't see an easy way of disabling it for these objects.

Thanks,
Ben

Tankut Koray said...

Hi Ben,

I think I can bind it to a Sortable property but I can look at it at weekend.

Tankut

Ben Bodien said...

Thanks!

(Sorry, just realised I commented in a completely irrelevant blog post) :)

Peter said...

Very usefull, thanks !!

borith said...

selected date of the calendar is only the initialize date we set. the value from the selecteddate is always the same as the initialize value. how can we change it?