Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Why does setting EnableViewState=false on PostBack de-select the items that are selec

    Fellow ASP.NETers,

    For the page I am currently working on, I have two ComboBoxes and an ASP.NET checkbox list. The first ComboBox filters the second ComboBox, and the second ComboBox populates the ASP list. The issue I am having is that if I leave EnableViewState set to true for the second ComboBox, it does not display the filtered results. When I set EnableViewState to false the second ComboBox and the first work perfectly, but on PostBack all of the selected items on the asp list get deselected.

    Yes I am a 100% sure it is the EnableViewState that is causing the issue. Any ideas?

    PLEASE HELP ME FIX THIS!!! I really need to its urgent!! I will vote best answer for this because I can't seem to solve this issue.

  • #2
    New Coder
    Join Date
    Aug 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    UpdatePanels could be the answer.

    If the items are placed in an update panel you can trigger an action to update a particular update panel.

    This also leaves anything outside of the update panel untouched on postback.

  • #3
    New Coder
    Join Date
    Aug 2011
    Posts
    50
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Understanding Viewstates

    I think it's obvious the viewstate is responsible for saving values between postbacks.

    For more detail refer to the following:

    http://msdn.microsoft.com/en-us/library/ms972976.aspx

    http://weblogs.asp.net/infinitiesloo...Viewstate.aspx


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •