SelectedIndex only works when page displayed for first time

Discussion in 'ASP .Net Web Controls' started by Tony Z, Mar 8, 2005.

  1. Tony Z

    Tony Z Guest

    I am stepping through a dataset on my web page and trying to set the
    SelectedItem f\or a dropdownlist each time i go to the next row in the
    dataset. However, setting the SelectedItem only works the first time the page
    is displayed. Each time I step though the data set after the first, all the
    data on the form changes EXECPT the selected item in the droplist list.
    Looking at the pagesource from the browser shows NO selection in the list.

    Any deas?
     
    Tony Z, Mar 8, 2005
    #1
    1. Advertising

  2. Tony Z

    quaester Guest

    Try disabling the viewstate for the control, since it seems like you are
    binding your controls again for each request.

    "Tony Z" wrote:

    > I am stepping through a dataset on my web page and trying to set the
    > SelectedItem f\or a dropdownlist each time i go to the next row in the
    > dataset. However, setting the SelectedItem only works the first time the page
    > is displayed. Each time I step though the data set after the first, all the
    > data on the form changes EXECPT the selected item in the droplist list.
    > Looking at the pagesource from the browser shows NO selection in the list.
    >
    > Any deas?
     
    quaester, Mar 9, 2005
    #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. =?Utf-8?B?QW5nZWxhQw==?=

    ActiveX object only works first time...

    =?Utf-8?B?QW5nZWxhQw==?=, Dec 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    329
    =?Utf-8?B?QW5nZWxhQw==?=
    Dec 6, 2004
  2. TS
    Replies:
    2
    Views:
    3,230
    sourabhsorate
    Dec 16, 2008
  3. novel
    Replies:
    5
    Views:
    652
    Andrew Thompson
    Jan 20, 2004
  4. K B
    Replies:
    0
    Views:
    434
  5. Brian Takita
    Replies:
    2
    Views:
    142
    Brian Takita
    Jul 25, 2005
Loading...

Share This Page