ross dickinson: web and desktop software developer

Using Enums in ViewState

by Ross on September 15, 2010 at 9:25 PM under ASP.Net

If you're having an issue with trying to figure out why your ViewStates are so large, check to see if you're storing any enum values inside the ViewState. ASP.Net stores each enum type's fully qualified assembly name inside the ViewState, which really bulks up the ViewState length.

An easy way to get around this is to convert the enum values to their basic value types before storing them to ViewState.

Comments (1) -

Looks like you're really getting into the .net technologies. You should look at their MVC framework and rid yourself of viewstate completely.

Add comment

  • Comment
  • Preview

About the author

rossisdead is a 26 year old web and desktop software developer from New Jersey. He has two cats and likes long walks on the beach.

On Stackoverflow

On Stackoverflow Careers

On Codeplex

On Github