3
Answers

Displaying number of days in label

ancy chacko

ancy chacko

9y
570
1
i have two calender and two dropdownlist. i want to check number of days.needs of dropdownlist is checking halfday or fullday.
halfday is 0.5 and full day is 1
 i want to use the conditions....like if ....
where?

coding:

DateTime FromYear = Convert.ToDateTime(calfrom.SelectedDate);
            DateTime ToYear = Convert.ToDateTime(calto.SelectedDate);
            TimeSpan objTimeSpan = ToYear - FromYear;


            double Days = Convert.ToDouble(objTimeSpan.TotalDays );
           
            Label1.Text = Convert.ToString(Days);
Answers (3)