Question on dropdownlist

Discussion in 'ASP .Net' started by Tony, Jul 16, 2003.

  1. Tony

    Tony Guest

    Hi, I need a dropdownlist to select month from 1 to 12. Is there a way that
    I don't need to databind with a database table? cos i just feel a little
    stupid to create a Month table have int from 1 to 12 in it.
     
    Tony, Jul 16, 2003
    #1
    1. Advertising

  2. Hi Tony,

    Select the DropDownList, press F4, click the "..." on the Items property and
    add your items there.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "Tony" <> wrote in message
    news:%...
    > Hi, I need a dropdownlist to select month from 1 to 12. Is there a way

    that
    > I don't need to databind with a database table? cos i just feel a little
    > stupid to create a Month table have int from 1 to 12 in it.
    >
    >
    >
     
    Victor Garcia Aprea [MVP], Jul 16, 2003
    #2
    1. Advertising

  3. You can use the DropDownList.Items.Add method to add the months at run time.
    Here's more info and an example:
    http://msdn.microsoft.com/library/d...uiwebcontrolslistitemcollectionclasstopic.asp

    Or you could just add the values to your HTML at design time.
    Here's more info and an example:
    http://msdn.microsoft.com/library/d...temWebUIWebControlsDropDownListClassTopic.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net



    "Tony" <> wrote in message
    news:%...
    > Hi, I need a dropdownlist to select month from 1 to 12. Is there a way

    that
    > I don't need to databind with a database table? cos i just feel a little
    > stupid to create a Month table have int from 1 to 12 in it.
    >
    >
    >
     
    Steve C. Orr, MCSD, Jul 16, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,602
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,236
    tshad
    Oct 19, 2005
  3. =?Utf-8?B?SnVhbmpv?=

    GridView: Filtr DropDownList from another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,870
    =?Utf-8?B?SnVhbmpv?=
    Dec 23, 2005
  4. =?Utf-8?B?SnVhbmpv?=

    GridView: Filter DropDownList for another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,302
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. keithb
    Replies:
    1
    Views:
    12,011
    shauns1
    Nov 1, 2006
Loading...

Share This Page