General discussion


Using the ASP.NET calendar control

By RexWorld ·
article root

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Selecting multiple dates

by RexWorld In reply to Using the ASP.NET calenda ...

If you need to mark a group of dates as selected - for example, all of next weekend - you can use the ASP.NET Calendar() object's handy "SelectedDates" property to select a collection of dates. See more at:

Collapse -

Sorry about that

by RexWorld In reply to Selecting multiple dates

Sorry about the line-break in that hyperlink. Mybad--this one should work:

Collapse -

Diff between two calendar dates

by SnoopDoug In reply to Using the ASP.NET calenda ...

It's not rocket science, but with two calendar controls you can quickly get the time between two dates. I do this every so often when we set our yearly vacation--my wife and daughter always want to know how long it is until our vacation.

Here's the bit of code that gets and displays the number of days between two calendar dates and displays it to the user in a textbox:

System.TimeSpan diff = this.Calendar2.SelectedDate.Subtract(this.Calendar1.SelectedDate);

this.TextBox3.Text = diff.Days + " days";


Back to Desktop Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums