Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

viewstate question

Status
Not open for further replies.

ecannizzo

Programmer
Sep 19, 2000
213
US
Where I work Viewstate is shut off for every project in the web.config. I'm told it's because viewstate is inefficient and unnecessary.

I was wanting to know if other programmers felt that way and what your reasons behind it might be? Or do you disagree with the statement?
 
Viewstate is less effecient than Session or Cache because it must be (de)serialized. It also can exponentially increase the size of a webpage when working with DataSourceObjects and Grid/Form/DetialViews.

However viewstate is convient because you don't need to manage objects like session/cache or query the db when visting a page. And depending on bandwidth file size may not be an issue. (intranet, cable modem, dsl, dial-up)

All in all, there is no right answer. Viewstate is a tool for web programming which serves a purpose. Like all tools they can be used incorrectly.

Personally, I won't write off viewstate altogether. The more I develope the more I find ways to reduce the viewstate size by utilizing output caching, session/application/cache objects and other programming techniques.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top