Hi people:
I have three dropdown controls in my page for selecting birthdate. How can I filter the values on my controls, in order to show to the user only those days available for that specific year and month???
For instance if the user selects Year: 2008, Month: Feb... then the day dropdown control must show from 1 to 29 because 2008 was a leap year. But if the user selects Year: 2009, Month: May... then the day dropdown control must show from 1 to 31.

Thanks in advance

YOU CAN USE THE BELOW C# BUILT IN METHOD TO ACHIEVE YOUR REQUIREMENT:

DateTime.DaysInMonth(dDate.Year, dDate.Month)

to get the no of days from a given year & month just use DaysInMonth method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.