Home > Microsoft .Net Development Tips > ASP.NET Development > Pandering to persistent page states
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ASP.NET DEVELOPMENT

Pandering to persistent page states


Ed Tittel, Contributor
01.19.2006
Rating: --- (out of 5)


ASP.NET Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


One of the nice new features in ASP.NET 2.0 is added support for a different location in which to store ViewState data for Web pages. In fact, you can create and use a new class to store ViewState information on the server side rather than having to pass it back and forth from client to server in a hidden HTML text field.

Within an ASP.NET control, developers can use ViewState and control state values to maintain state information between page and other resource requests from a client browser. But most methods for capturing and maintaining state information depend on building and passing hidden text fields from client to server inside requests and then passing an updated version of that same information back to the client when the request gets a reply from the server. This is how information remains available, or persistent, from one page view or resource request to the next.

ASP.NET ups the ante by providing two page state persisters to enable developers to maintain state information over time. The HiddenFieldPageState persister maps to the old-fashioned back-and-forth model where state information goes into a hidden text field and bounces back and forth, while the SessionPageStatePersister uses server sessions associated with a specific browser session to store the data on the server side.

This helps keep overhead to a minimum, since large amounts of hidden data no longer need to travel between client and server with each page access. On the other hand, adding session support for persistent data increases serv


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
ASP.NET Development
How to use jQuery to solve Javascript browser compatibility problems
How to write an out-of-browser Silverlight 3 application in 3 steps
Silverlight 3 beta SDK download lets developers try new RIA features
Visual Studio's IntelliSense for jQuery doesn't autocomplete correctly
Dundas Map for .NET kicks up geographic visualization
Return to CodePlex: Into the Sandcastle…
VBScript Tutorial
Use PHP with Visual Studio to create Web sites
Visual Studio Team System Add-ins: Conchango Scrum for Team System and Scrum Dashboard
Visual Studio 2008 and .NET Framework 3.5 SP1 introduces ADO .NET Entity Designer

ASP.NET development best practices
Introduction to ASP.NET's Model View Controller (MVC) Design Pattern
Silverlight, Ajax components require different approach to UI
LINQ Learning Guide: LINQ and Web applications
VB code download home page
VB code: File manipulation downloads
Localization practices for .NET 2.0: It's still about the architecture
Creating custom ASP.NET 2.0 profile providers
.NET development in the trenches
Microsoft developers balancing age-old issues, barrage of new technology
SearchVB.com's Podcast Page

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
136 browser colors with names  (SearchWinDevelopment.com)
ASP.NET  (SearchWinDevelopment.com)
browser  (SearchWinDevelopment.com)
Document Object Model  (SearchWinDevelopment.com)
domain name  (SearchWinDevelopment.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


er activity and overhead, and consumes more server resources. Nor are hidden fields subject to timeouts the way sessions must be, to prevent them from dragging on forever. But because applications can store persistence data in a database, the load can be shared with other servers, and good timeout choices can prevent overly quick timeouts from disrupting meaningful user activity.

Because the HiddenFieldPageState is the default persister, you must override the PageStatePersister property of a page and return an instance of your persister of choice. Matt Gibbs' article ASP.NET 2.0 Page State Persister not only explains the details of how to use the SessionPageStatePersister, it also provides in-depth views of HTML source code for real Web pages to illustrate how much data volume is reduced when state information stays on the server, and only update information needs to move back and forth instead of an entire state image, as it were.

Those who can handle the increased consumption of resources on the server side, and whose users won't be overly discommoded by occasional timeouts owing to inactivity or communications problems, should definitely dig deeper into this technique. It can be of great value for applications or services where client bandwidth is limited and where sensitive transactions do not (or only seldom) occur.


Ed Tittel is a full-time writer and trainer whose interests include XML and development topics, along with IT Certification and information security topics. E-mail Ed at etittel@techtarget.com with comments, questions, or suggested topics or tools to review.

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts