Hi,
I can populate the following DropDownList of months using this code.
for (int month = 1; month <= 12; month++)
{
string monthName = DateTimeFormatInfo.CurrentInfo.GetMonthName(month);
ddl_month.Items.Add(new ListItem(monthName.ToString().ToUpper(), month.ToString()));
}
But now I have to display the single month in dropdownlist of months, according to this scheme…
Month |
Last_Date |
JANUARY |
2024-03-01 |
FEBRUARY |
2024-04-05 |
MARCH |
2024-05-03 |
APRIL |
2024-06-07 |
MAY |
2024-07-05 |
JUNE |
2024-08-02 |
JULY |
2024-09-06 |
AUGUST |
2024-10-04 |
SEPTEMBER |
2024-11-01 |
OCTOBER |
2024-12-06 |
NOVEMBER |
2025-01-03 |
DECEMBER |
2025-02-07 |
If we are in February I can only see January (I have to answer it by the first week of March) and so on when we are in March I will see February it is an N-1.