I have a page with several expandable lists. In a perfect world, I would like to display links to each of these lists and when one is clicked it will reload the page with that particular list displayed. I read that ViewState can eliminate the need for hidden input fields, query strings, etc, but I am not familiar with the concept.
Basically I need to accomplish two things:
- Add ID of list to ViewState obj when link is clicked
- Read ID from ViewState obj when page is loaded, display that list
Can anyone provide me with some resources and/or help on this topic? Thanks!
ViewState is essentially one long encoded hidden field, stored at the top of your page. The key difference between that and a regular hidden field is that ASP .NET will decode it and parse it automatically on a postback.
There are better ways to achieve what you want to do.