AspNet.ViewState.NCache
5.3.801
dotnet add package AspNet.ViewState.NCache --version 5.3.801
NuGet\Install-Package AspNet.ViewState.NCache -Version 5.3.801
<PackageReference Include="AspNet.ViewState.NCache" Version="5.3.801" />
<PackageVersion Include="AspNet.ViewState.NCache" Version="5.3.801" />
<PackageReference Include="AspNet.ViewState.NCache" />
paket add AspNet.ViewState.NCache --version 5.3.801
#r "nuget: AspNet.ViewState.NCache, 5.3.801"
#:package AspNet.ViewState.NCache@5.3.801
#addin nuget:?package=AspNet.ViewState.NCache&version=5.3.801
#tool nuget:?package=AspNet.ViewState.NCache&version=5.3.801
AspNet.ViewState.NCache
This package lets you offload ASP.NET View State storage to NCache instead of the default hidden field storage embedded in the page, reducing page payload size and centralizing View State across a distributed, highly available cache cluster.
Installation
Install-Package AspNet.ViewState.NCache
or, using the .NET CLI:
dotnet add package AspNet.ViewState.NCache
What is Installed
Installing this package adds the following configuration file to your project:
- viewState.xml — Contains provider-specific configuration for View State caching: which cache to use, and which web apps/groups/pages it applies to. By default, the
cache-namefield points todemoCache.
Prerequisites
- .NET Framework 4.6.2+ Application.
- NCache SDK 5.3.801 or later.
- An NCache 5.3.801 (or later) server should be up and running, with the target cache already created/registered on it.
Getting Started
Setting up NCache
- Open your application's configuration file:
- .NET Framework / ASP.NET:
app.configorweb.config
- .NET Framework / ASP.NET:
- Add an entry for the cache you created on the NCache server, keyed by the cache's name. The
example uses
defaultCache; replace it with your cache's name. - Set
serverto one or more nodes of the cluster where that cache is running. Separate multiple nodes with commas.
app.config / web.config
<configuration>
<configSections>
<section name="ncache" type="Alachisoft.NCache.Client.NCacheSection, Alachisoft.NCache.Client" />
</configSections>
<ncache>
<caches>
<add name="defaultCache" server="20.200.20.24,20.200.20.25" port="9800" />
</caches>
</ncache>
</configuration>
The cache name in the configuration must match the name you pass in code:
ICache cache = CacheManager.GetCache("defaultCache");
Setting up View State Configuration
The viewState.xml file controls which pages use NCache backed View State, and which cache each of them uses.
- The file can contain multiple web app configurations.
- Each web app configuration can contain one or more group configurations.
- Each group lists the pages it applies to under a
<pages>section, using the relative URL of each page. - Different groups can use different caches by setting the
cache-namefield per group. Default isdemoCache. - If a page isn't found in any group in
viewState.xml, the default settings fromWeb.configare used instead. - If a property is missing for a group, the default value from
Web.configis used for that property.
Example structure :
<webApps>
<webApp name="MyWebApp">
<group name="Group1" cache-name="demoCache">
<pages>
<page url="~/Default.aspx" />
<page url="~/Account/Login.aspx" />
</pages>
</group>
</webApp>
</webApps>
Configuration
| File | Purpose |
|---|---|
Client.ncconf |
Cache server addresses for each cache the application needs to access. |
Config.ncconf |
Local config for inproc cache / inproc client cache. For a client cache, must include the name of the clustered cache it belongs to. |
viewState.xml |
Maps web apps → groups → pages to specific caches, with demoCache as the default. |
Resources
Technical Support
Alachisoft provides various technical support resources. Visit the Alachisoft Support Center to select a support resource appropriate for your issue. To request additional features or report a documentation discrepancy, contact support@alachisoft.com.
License
Copyright © 2026 Alachisoft. All rights reserved.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Alachisoft.NCache.SDK (>= 5.3.801)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.