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. Advertising

  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. 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. blenderdude
    Replies:
    0
    Views:
    1,066
    blenderdude
    Aug 3, 2003
  2. DC Gringo
    Replies:
    0
    Views:
    408
    DC Gringo
    Apr 6, 2004
  3. kent
    Replies:
    1
    Views:
    883
    Andrew de la Harpe
    May 3, 2004
  4. Simon Prince
    Replies:
    2
    Views:
    3,339
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  5. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,654
    Chris Kettenbach
    Jun 16, 2005
Loading...

Share This Page