Date Dropdown entry - Adjusting number of days based on month

W

wrecker

Hi All,

I'm just starting to create my first asp.net form and I require the
user to enter a date. I've decided to go with three drop down lists
to allow the user to enter the month, the day, and the year. Is there
a way that I can dynamically adjust the number of days the user is
allowed to choose from based on what month they pick? For example, if
the user selects January the day dropdown will display 31 days (1
through 31). If instead the users selects April, the day dropdown
will only display 30 days.

Is this easily accomplished? I guess the part that I'm concerned
with causing the biggest problem is the updating of the page to change
the dropdown range. Will the entire page have to reload or can I
simple adjust that single control?

Thanks for any help

Rene
 
K

Ken Cox [Microsoft MVP]

Hi Rene,

I'm just wondering why you don't just use a calendar control. It allows
users to pick a date and as they select the month, it only shows the
available days.

Anyway, it sounds like you want to avoid postbacks, so you might be better
off implementing this in client-side Javascript to make it dynamic.

Ken
 
F

Felbrigg

If your willing to postback to the server you can iterate throught the
controls Items collection and remove individual items and or add them back
in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top