Calender control
I want to add two date from two different calender control and to display that result in textbox. how to do that .Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
jothi donaPosted Mar 18, 2015, 2:19 AM
Pankaj Kumar ChoudharyPosted Mar 17, 2015, 9:50 AM
aspx Code:
Aspx.cs Code:
DateTime Dt;
Double Day;
int Month;
int Year;
TimeSpan Spn;
protected void Button1_Click(object sender, EventArgs e)
{
DateTime DT=Calendar2.SelectedDate;
Day = Convert.ToDouble( Calendar1.SelectedDate.Day.ToString());
Month = Convert.ToInt32( Calendar1.SelectedDate.Month.ToString());
Year = Convert.ToInt32( Calendar1.SelectedDate.Year.ToString());
Dt.AddDays(Day);
Dt.AddMonths(Month);
Dt.AddYears(Year);
TextBox1.Text = Dt.ToString();
}