• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
Show / Hide Table of Contents

Group ASP.NET View State with Session

NCache provides a feature that allows to group ASP.NET View State with a particular session. Due to this dependency, as the session expires, the View State associated with it expires too. The View State and session can reside either on two different caches or on a same cache. To enable this feature, expireViewstateWithSession should be set as True in the ncContentOptimization tag.

<ncContentOptimization>
    <settings enableMinification="false"
               enableViewstateCaching="true"
               groupedViewStateWithSessions="true"
               viewstateThreshold="1"
               cacheUriMapping="true"
               enableTrace="true"
               expireViewstateWithSession="true"
               sessionCacheName="demoSessionCache"
               sessionAppId="demoApp">
      <cacheSettings cacheName="demoCache">
        <expiration type="None" duration="0" >
      </cacheSettings>
    </settings>
  </ncContentOptimization>

Group ASP.NET View State with Session Configuration Members

Following is the grouping for ASP.NET View State with Session Configuration Members:

Member Description
groupedViewstateWithSessions Through this property a session can be grouped with ASP.NET View State. All the View States for a session are grouped with sessionId. This allows the retrieval of all View States grouped with a sessionId from the cache with group information. Set this property to True to enable View State grouping with sessions, it's False by default.
expireViewstateWithSession Setting this property to True will ensure that when a session expires, its associated View State expires too.
sessionAppId Specifies an identifier to ensure that sessionId remains unique in case multiple applications use the same cache. Its value should be the same as the sessionAppId in the sessionState tag.
sessionCacheName The name of the cache on which the session data resides. Its value should be the same as the cacheName property in the session state tag.

See Also

Configuring and Using NCache Content Optimization
Limit View State Caching
Page Level Grouping for View State
Distributed Cache for ASP.NET Output Caching
ASP.NET SignalR Backplane Overview

In This Article
  • Group ASP.NET View State with Session Configuration Members
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top