Watch this on YouTube:
error while executing the following code:
public IEnumerable<SelectListItem> Months
{
get
{
return DateTimeFormatInfo
.InvariantInfo
.MonthNames
.Select((monthName, index) => new SelectListItem
{
Value = (index + 1).ToString(),
Text = monthName
});
}
}
To fix it - add the following using:
using System.Globalization;
No comments:
Post a Comment