Dropdownlist items get empty on postback

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • antony1991
    New Member
    • Mar 2014
    • 1

    Dropdownlist items get empty on postback

    In my page , i have 2 dropdowns . i am populating them through javascript and accessing them on button click. but the values of the dropdowns getting empty. can u suggest any solution?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    You need to remember what your DropDownLists were populated with between server request/responses. You can use hidden fields if you just need to maintain the values between server requests for a particular page...or if you need to remember this between pages you could use cookies.


    Once you have the information about what the DropDownLists were populated with you can repopulate them on page load (or ajax return).

    -Frinny

    Comment

    Working...