Summary
The ASP.NET Framework provides a rich set of features for leveraging client-side functionality, including JavaScript. The ViewState and ControlState features use HTML hidden input to store state information on the client, which saves you from writing a lot of redundant boilerplate code. However, you must carefully monitor ViewState because it can quickly bloat your requests and responses. Version 2.0 increases the efficiency of the hashing algorithms in use to generate the ViewState value, decreasing the size of the value stored in the hidden input. In some situations, the ViewState size will still cause an unacceptable performance hit; in these cases, you have the option of replacing the location where the ViewState value is stored with one of your choosing (like Session, Cache, or a database).
ASP.NET script-generation features have been aggregated and extended via the services the new ClientScript object provides. This object, a property of the Page object, exposes many methods you can use to generate JavaScript, and to avoid sending duplicate blocks of JavaScript to the client.
There is a powerful new facility for doing out-of-band callbacks from the client to the server, which allows you to do partial page refreshes and avoid the overhead of a full postback to the server.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2006 Dominic Selly, Andrew Troelsen, and Tom Barnaby
About this chapter
Cite this chapter
(2006). ViewState and Scripting. In: Expert ASP.NET 2.0. Apress. https://doi.org/10.1007/978-1-4302-0073-4_4
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0073-4_4
Publisher Name: Apress
Print ISBN: 978-1-59059-522-0
Online ISBN: 978-1-4302-0073-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)