Author: kbainey1 | Posted on: 8/12/2009 12:57:23 PM | Views : 264

 Why does the followng code not work?
public partial class _Default : System.Web.UI.Page { protected void Date1(object sender, EventArgs e) { Label1.Text = "Selected date is: " + Calendar1.SelectedDate.ToShortDateString(); } protected void Date2(object sender, EventArgs e) { Label2.Text = "Selected date is: " + Calendar2.SelectedDate.ToShortDateString(); } protected void Button1_Click(object sender, EventArgs e) { TimeSpan ts = Date1 - Date2; int numberOfDays = ts.Days; Label3.Text = numberOfDays; } }
 
...

Go to the complete details ...