Save RadGrid ViewState in Session
When RadGrid uses features that require ViewState, disabling EnableViewState is not an option. You can instead move ASP.NET page state from the hidden field to Session to reduce the amount of state sent to the browser.
This approach requires ASP.NET Session state and increases server-side memory or session-storage usage. Evaluate session capacity, serialization, and load-balancing requirements before applying it. The ASP.NET SessionPageStatePersister does not store control state in Session by default, so configure RequiresControlStateInSession=true when the page depends on control state.
Configure SessionPageStatePersister
Add the following field and PageStatePersister property to the page code-behind. The example applies to ASP.NET 3.x and 4.x.
Store ASP.NET page state in Session for a RadGrid page
using System.Web.UI;
private PageStatePersister _persister;
protected override PageStatePersister PageStatePersister
{
get
{
if (_persister == null)
{
_persister = new SessionPageStatePersister(this);
}
return _persister;
}
}Store control state in Session with ASP.NET page state
<system.web>
<browserCaps>
<case>
RequiresControlStateInSession=true
</case>
</browserCaps>
</system.web>
For more information, see the PageStatePersister class reference.