dropdownlist Question

Discussion in 'ASP .Net' started by chongo, Feb 19, 2004.

  1. chongo

    chongo Guest

    Hi,

    I'm a newbie to asp.net. Actually i'm working on my first page now.

    I have a drop list <asp:DropDownList id="menu" AutoPostBack="True"
    OnSelectedIndexChanged="onChange" runat="server">

    The problem that I am having is when I call my onChange Method, the
    dropdown list selects the proper index but overides the selected value
    to 0.

    <select name="menu" id="nenuButton" SelectedIndexChanged="onChange"
    onchange="__doPostBack('menuButton','')" language="javascript">
    <option value="0">None</option>
    <option value="21">beer</option>

    ==> <option selected="selected" value="0">pizza</option>

    <option value="23">Ret</option>
    <option value="2">Sandwiches</option>
    </select>

    Any help would be greatly appreciated.
    -dan
    chongo, Feb 19, 2004
    #1
    1. Advertising

  2. How are the ListItems getting into the DropDownList?

    This looks like you have copied the html code from a rendered aspx page.


    bill

    "chongo" <> wrote in message
    news:...
    > Hi,
    >
    > I'm a newbie to asp.net. Actually i'm working on my first page now.
    >
    > I have a drop list <asp:DropDownList id="menu" AutoPostBack="True"
    > OnSelectedIndexChanged="onChange" runat="server">
    >
    > The problem that I am having is when I call my onChange Method, the
    > dropdown list selects the proper index but overides the selected value
    > to 0.
    >
    > <select name="menu" id="nenuButton" SelectedIndexChanged="onChange"
    > onchange="__doPostBack('menuButton','')" language="javascript">
    > <option value="0">None</option>
    > <option value="21">beer</option>
    >
    > ==> <option selected="selected" value="0">pizza</option>
    >
    > <option value="23">Ret</option>
    > <option value="2">Sandwiches</option>
    > </select>
    >
    > Any help would be greatly appreciated.
    > -dan
    William F. Robertson, Jr., Feb 19, 2004
    #2
    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,594
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,228
    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,862
    =?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,294
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. keithb
    Replies:
    1
    Views:
    11,970
    shauns1
    Nov 1, 2006
Loading...

Share This Page