대신 사용 :년 및 월 번호가있는 달의 일을 계산 하시겠습니까?
int noOfDaysInMonth = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
내가 한 달에 일의 수를 얻기 위해 전달 된이 개 값을 사용하려면 :
이public ActionResult Index(int? month, int? year)
{
DateTime Month = System.Convert.ToDateTime(month);
DateTime Year = System.Convert.ToDateTime(year);
int noOfDaysInMonth = DateTime.DaysInMonth(Year, Month);
(년, 월) 잘못된 인수하지 않다고 생각된다? 어떤 아이디어? 어쩌면 system.conert.todatetime.month?
null 인 경우 어떻게해야합니까? – Renan
@Renan : edited. –