Dropdown is maintaining itz state after postback

Discussion in 'ASP .Net' started by =?Utf-8?B?RGVlcHNvbiBUaG9tYXM=?=, May 30, 2006.

  1. Hi,
    Currently iam facing a strange problem.. One dropdown in my page is
    keeping itz state after postback. Whichever the item i selected is not the
    selected item after postback. it goes back to the first item again. This
    happens even if i submitted the page by making the AutoPostback of the
    dropdown true or by clicking on the submit button. Even itz not going to the
    DropDownList1_SelectedIndexChanged method.

    A checking is already there at page load event to avoid filling the dropdown
    at the time of postback.

    The items are populating from database. The intresting matter is, this
    problem comes only when i fill the dropdown from the database. if iam
    hardcoding the items then this problem is not there. That time itz
    maintaining the state.

    Anybody hav any idea what may be the problem

    --
    Deepson Thomas
    =?Utf-8?B?RGVlcHNvbiBUaG9tYXM=?=, May 30, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?RGVlcHNvbiBUaG9tYXM=?=

    Brock Allen Guest

    It sounds like you're always repopulating the DropDownList in Page_Load (or
    whereever you're accessing the database). Try to only populate the DropDownList
    the first request in, so check !IsPostBack.

    -Brock
    http://staff.develop.com/ballen


    > Hi,
    > Currently iam facing a strange problem.. One dropdown in my page is
    > keeping itz state after postback. Whichever the item i selected is not
    > the
    > selected item after postback. it goes back to the first item again.
    > This happens even if i submitted the page by making the AutoPostback
    > of the dropdown true or by clicking on the submit button. Even itz not
    > going to the DropDownList1_SelectedIndexChanged method.
    >
    > A checking is already there at page load event to avoid filling the
    > dropdown at the time of postback.
    >
    > The items are populating from database. The intresting matter is, this
    > problem comes only when i fill the dropdown from the database. if iam
    > hardcoding the items then this problem is not there. That time itz
    > maintaining the state.
    >
    > Anybody hav any idea what may be the problem
    >
    Brock Allen, Jun 1, 2006
    #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. Tom wilson
    Replies:
    2
    Views:
    2,632
    Tom wilson
    Feb 11, 2005
  2. Tom wilson
    Replies:
    2
    Views:
    567
    Tom wilson
    Feb 14, 2005
  3. =?Utf-8?B?RGVlcHNvbiBUaG9tYXM=?=

    Dropdown is not maintaining itz state after postback

    =?Utf-8?B?RGVlcHNvbiBUaG9tYXM=?=, May 30, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    612
    Mark Rae
    May 31, 2006
  4. consultant

    C Ebooks, Itz my effort

    consultant, May 2, 2007, in forum: C Programming
    Replies:
    3
    Views:
    366
  5. muzzy
    Replies:
    1
    Views:
    242
    Jan Limpens
    Nov 7, 2003
Loading...

Share This Page