In previous post I showed an approach combining DynamicObject with ViewState for accessing ViewState members using dynamic properties instead of string indexes. However that approach had some disadvantages:
- It is tied some a concrete base page class.
- It does not have all the properties/methods of StateBag class
- Mixing ViewState and ViewBag can be confusing for new developers.