DropDownList Problem

Discussion in 'ASP .Net' started by Jl_G_0, Jan 3, 2007.

  1. Jl_G_0

    Jl_G_0 Guest

    Hey all, searched several topics on this, but couldnt find the answer
    to my problem.

    I have 2 DropDownLists, and the first should fill the second when
    selected. So I changed its AutoPostBack to TRUE, and created a
    SelectedIndexChanged function to it.

    The problem is, when I change the value on it, it just posts back, and
    resets its value (and every DropDownLists value too) to the default
    value. It doesnt do any of the action on the SelectedIndexChanged Sub.

    The dropdownlist is being filled manually on the HTML part of the
    page. (on the future it will be loaded from a SQL base, when its
    working).

    Anyone know whats wrong here ? Thx.
    Jl_G_0, Jan 3, 2007
    #1
    1. Advertising

  2. Jl_G_0

    David Wier Guest

    Off hand, I'm not sure -
    My recommendation, though, since you're planning filling the first ddl from
    a database anyway, is to go ahead and do it.
    Just make sure, in the Page_Load, include the loading of the ddl inside an
    if/then/Postback block.

    --
    David Wier
    MVP/ASPInsider
    http://aspnet101.com
    http://aspexpress.com


    "Jl_G_0" <> wrote in message
    news:...
    > Hey all, searched several topics on this, but couldnt find the answer
    > to my problem.
    >
    > I have 2 DropDownLists, and the first should fill the second when
    > selected. So I changed its AutoPostBack to TRUE, and created a
    > SelectedIndexChanged function to it.
    >
    > The problem is, when I change the value on it, it just posts back, and
    > resets its value (and every DropDownLists value too) to the default
    > value. It doesnt do any of the action on the SelectedIndexChanged Sub.
    >
    > The dropdownlist is being filled manually on the HTML part of the
    > page. (on the future it will be loaded from a SQL base, when its
    > working).
    >
    > Anyone know whats wrong here ? Thx.
    >
    David Wier, Jan 3, 2007
    #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,582
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,206
    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,848
    =?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,283
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. keithb
    Replies:
    1
    Views:
    11,916
    shauns1
    Nov 1, 2006
Loading...

Share This Page