Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ClientRoleProvider.ResetCache Method

Clears the cached role information and resets the cache time-out period.

Namespace:  System.Web.ClientServices.Providers
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
public void ResetCache()

The ResetCache method removes all role information from the local cache and causes the cache to expire. After you call this method, your next call to the GetRolesForUser or IsUserInRole method will retrieve role information from the configured role service instead of the local cache.

You can use this method to enable users to refresh the roles cache when their role has changed but the cache has not yet expired. For information about how to set the roles cache time-out interval, see How to: Configure Client Application Services.

The following example code demonstrates how to use this method to reset the local roles cache.


private void ResetRolesCache()
{
    ((ClientRoleProvider)System.Web.Security.Roles.Provider).ResetCache();
}


.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.