0

There is SqlPersonalizationProvider and I have also defined other CustomPersonalizationProvider In the page where I have multiple webparts, I need to have functionality to reset the state of Webparts to emply or delete the state.

There exists a defined method System.Web.UI.WebControls.WebParts.PersonalizationProvider.ResetState which can be called, with page path and username. I could not find a way to get object of current provider, so I can call this method to delete state.

Vishnu
  • 2,135
  • 2
  • 30
  • 51

1 Answers1

0

I found that we can get Current Providers using PersonalizationAdministration.Provider and to reset state there are methods in providers like:

PersonalizationAdministration.Provider.ResetState(PersonalizationScope.Shared, paths, null);
or
PersonalizationAdministration.Provider.ResetState(PersonalizationScope.Private, paths, username);
Vishnu
  • 2,135
  • 2
  • 30
  • 51