Problems with ListBox Control

Discussion in 'ASP .Net Web Controls' started by Nayak, Jun 13, 2005.

  1. Nayak

    Nayak Guest

    On my web page, I want to let the user change the order of items in the
    LISTBOX.
    I could do that using the javascript , but when the page is submitted the
    listbox is reset to its original values.
    what happenig here ?

    I am using ASP.Net with C# as the code behind
     
    Nayak, Jun 13, 2005
    #1
    1. Advertisements

  2. Nayak

    Brock Allen Guest

    The items in the DropDownList are stored in ViewState, so modifying the actual
    DDL in the HTML DOM doesn't affect the ViewState, and thus when posted back
    to the server isn't reflected in the server-side DDL. You'll need to build
    some other scheme to submit that info to the server. Typically a hidden input
    that you manipulate from the same javascript that reorders the DDL. Then
    on the server you'll have to reorder the DDL based upon that hidden.

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



    > On my web page, I want to let the user change the order of items in
    > the
    > LISTBOX.
    > I could do that using the javascript , but when the page is submitted
    > the
    > listbox is reset to its original values.
    > what happenig here ?
    > I am using ASP.Net with C# as the code behind
    >
     
    Brock Allen, Jun 13, 2005
    #2
    1. Advertisements

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. DC Gringo
    Replies:
    0
    Views:
    563
    DC Gringo
    Apr 6, 2004
  2. kent
    Replies:
    1
    Views:
    1,036
    Andrew de la Harpe
    May 3, 2004
  3. Simon Prince
    Replies:
    2
    Views:
    3,590
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  4. Nayak

    Problems with ListBox Control

    Nayak, Jun 13, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    443
    Brock Allen
    Jun 13, 2005
  5. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,882
    Chris Kettenbach
    Jun 16, 2005
  6. bh_jodokast

    Drag from one listbox to another listbox

    bh_jodokast, Oct 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    540
    bh_jodokast
    Oct 7, 2005
  7. Avneesh Kumar

    Facing problems with Dual listbox Custom Server Control

    Avneesh Kumar, Sep 4, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    384
    Andy Smith
    Oct 1, 2003
  8. Paul Reilly

    problems with listbox id changing within datagrid control

    Paul Reilly, Jun 21, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    248
    Rick Spiewak
    Jun 23, 2004
Loading...