ClientRoleProvider.ResetCache ClientRoleProvider.ResetCache ClientRoleProvider.ResetCache ClientRoleProvider.ResetCache Method


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

 void ResetCache();
public void ResetCache ();
member this.ResetCache : unit -> unit
Public Sub ResetCache ()


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

private void ResetRolesCache()
Private Sub ResetRolesCache()
    CType(System.Web.Security.Roles.Provider, ClientRoleProvider).ResetCache()
End Sub


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.

Applies to

See also