You can use javascript for this
function daysInMonth(month,year)
{
return new Date(year, month, 0).getDate();
}
If you want it to be done using c sharp ,call the below method using Ajax or on drop down change event.
public int GetDays(int year, int month){
return DateTime.DaysInMonth(year, month);
}