dropdown control - HELP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi & please ghelp. I'm very new to c#.

I've a combo box that needs to list monthy newsletter in the format:
<option value="year-month.html">year-month</option>
from April 2007 to this month

PLEASE show me how. Thanks!!
 
Chris,

Well, figure out what the current month/year is (using a call to the
static Now property on the DateTime class). Then, I would figure out what
the first of the month is. You can do that by subtracting the number of
days in today's date from that date, and then add one.

From there, you can just subtract one month from the datetime until you
hit April of 2007. Each time you iterate backwards, you would add the item
to your combobox.
 

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

Back
Top