question on DropDownList control.

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

  1. #1

    Default 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 data records in the selected year & month when
    i click "submit" button, but the weird thing is I can only get the records
    of 01/2000, no matter what year and month i selected from the drop down
    list.

    and when the page reloaded, the selected items in drop downlist set to year
    2000 and month 1.

    Who can give me a hint , what is wrong?
    I am sure the sql is right.

    Thank you so much!!


    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. dropdownlist control
      I have a form which displays a number of text boxes that are all data bound to a dataset. I want to change one of these text boxes to be a drop...
    3. 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...
    4. binding datasource to dropdownlist control
      I am being sent an ArrayList of ListItems. I can bind to a dropdownlist control using: oDropDownList.DataSource = oArrayList This works but...
    5. DropDownList control in DataGrid
      Hello all, I'l displaying a dropdownlist inside a datagrid. The problem comes when I try to get the values the user chose on postback. If I...
  3. #2

    Default Re: question on DropDownList control.

    am I use it correctly?

    String Year = MyDropDownList.SelectedItem.ToString();

    String Month = MyDropDownList2.SelectedItem.ToString();

    "Tony" <gdxing@hotmail.com> wrote in message
    news:Ous2fQrSDHA.3636@tk2msftngp13.phx.gbl...
    > 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 data records in the selected year & month
    when
    > i click "submit" button, but the weird thing is I can only get the records
    > of 01/2000, no matter what year and month i selected from the drop down
    > list.
    >
    > and when the page reloaded, the selected items in drop downlist set to
    year
    > 2000 and month 1.
    >
    > Who can give me a hint , what is wrong?
    > I am sure the sql is right.
    >
    > Thank you so much!!
    >
    >

    Tony Guest

  4. #3

    Default Re: question on DropDownList control.

    Do you set values declaratively or in code? If in code, you do that only on
    initial request hat is not on postback?

    --
    Teemu Keiski
    MCP,Designer/Developer
    Mansoft tietotekniikka Oy
    [url]http://www.mansoft.fi[/url]

    AspInsiders Member, [url]www.aspinsiders.com[/url]
    ASP.NET Forums Moderator, [url]www.asp.net[/url]
    AspAlliance Columnist, [url]www.aspalliance.com[/url]



    "Tony" <gdxing@hotmail.com> kirjoitti viestissä
    news:ef9cTSrSDHA.1552@TK2MSFTNGP12.phx.gbl...
    > am I use it correctly?
    >
    > String Year = MyDropDownList.SelectedItem.ToString();
    >
    > String Month = MyDropDownList2.SelectedItem.ToString();
    >
    > "Tony" <gdxing@hotmail.com> wrote in message
    > news:Ous2fQrSDHA.3636@tk2msftngp13.phx.gbl...
    > > 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 data records in the selected year & month
    > when
    > > i click "submit" button, but the weird thing is I can only get the
    records
    > > of 01/2000, no matter what year and month i selected from the drop down
    > > list.
    > >
    > > and when the page reloaded, the selected items in drop downlist set to
    > year
    > > 2000 and month 1.
    > >
    > > Who can give me a hint , what is wrong?
    > > I am sure the sql is right.
    > >
    > > Thank you so much!!
    > >
    > >
    >
    >

    Teemu Keiski 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