ClientRoleProvider.ResetCache Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Clears the cached role information and resets the cache time-out period.
public:
void ResetCache();
public void ResetCache ();
member this.ResetCache : unit -> unit
Public Sub ResetCache ()
Examples
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();
}
Private Sub ResetRolesCache()
CType(System.Web.Security.Roles.Provider, ClientRoleProvider).ResetCache()
End Sub
Remarks
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.
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om