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
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Mar 17, 2015, 5:50 AM EDT
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();
}
jothi dona14 reputationPosted Mar 17, 2015, 10:19 PM EDT