Question on dropdownlist

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Question on dropdownlist

    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 Guest

  2. Similar Questions and Discussions

    1. Question about a user control derived from DropDownList
      I posted this in a different group yesterday with no responses, so I'll try here. I have a simple control that is in a CS file (not ASCX). It is...
    2. HELP! DropDownList Items property in composite control -- collection editor support question!
      Hi, I have a composite web custom control consisting of a textbox, a button, and a dropdownlist.. I'm trying to expose the Items property from...
    3. HELP with ASP.NET DropDownList Box ! : )
      Hi all, I have a DropDownList on my page created in Design Time calledddlDate. In code, I do the following: 1 ddlDate = New DropDownList() <-...
    4. <asp:DropDownList >
      It just doesn't work like that - - you need to either bind data to the datalist in code, or manually add the items, one by one, where you're doing...
    5. question on DropDownList control.
      hi, a newbie question I have two dropdownlist controls, one is for years, 2000-2003, the other is for month, 1-12. I am supposed to get all the...
  3. #2

    Default Re: Question on dropdownlist

    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:
    [url]http://obies.com/vga/blog.aspx[/url]
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "Tony" <gdxing@hotmail.com> wrote in message
    news:%23djo9A0SDHA.3768@tk2msftngp13.phx.gbl...
    > 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] Guest

  4. #3

    Default Re: Question on dropdownlist

    You can use the DropDownList.Items.Add method to add the months at run time.
    Here's more info and an example:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolslistitemcollectionclass topic.asp[/url]

    Or you could just add the values to your HTML at design time.
    Here's more info and an example:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsDropDownListClassTopic. asp[/url]

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



    "Tony" <gdxing@hotmail.com> wrote in message
    news:%23djo9A0SDHA.3768@tk2msftngp13.phx.gbl...
    > 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139