Monday, March 11, 2013

ASP.NET WebForm ViewBag Property

Recently I developed some classic Asp.Net 3.5 webform pages, I need to use something like ViewBag present in Asp.NET MVC. For this reason I developed this small piece of code that is based on the ViewState. This code must be written in our ASP.NET page; after that should be set with a simple assignment. Obviously the TestClass must be serializable; In the markup of my page, I use the properties as follows: