I have a team working together 30 days and I have a textbox insert into date if you insert 01/01/2016(TextBox1) automatically display in autoPostBack 10/02/2016 (TextBox2)
I want if the team working together from 1-27 days the color of label change into green and from 28-29 days change color into yellow and more than 30 days the label color change into red.

Amit GuptaPosted Oct 18, 2016, 3:33 PM
Subtract the 2 dates and get total no of days
Timespan ts = Date2.Subtract (date1);
Int totalDays =ts.TotalDays;
if (totalDays <=27)
Label.ForeColor = Colors.Green;
else if (totalDays>=28 && totalDays <=29)
Label.ForeColor = Colors.Yellow;
else
Label.ForeColor = Colors.Red;
Abdalla ElawadPosted Oct 18, 2016, 9:12 AM
Milan PrajapatiPosted Oct 18, 2016, 9:06 AM