Wednesday, April 16, 2008

Reseting user personalization state

To manage personalization state of users, you must use the PersonalizationAdministration class. The following example shows how te reset state of the current user:

WebPartManager mgr = WebPartManager.GetCurrentWebPartManager(Page);

To reset state of a particular user, use the following code snippet:

For managing user state, refer to

// Reset the user.
if (! PersonalizationAdministration.ResetUserState("~/Default.aspx", txtUser.Text))
Response.Write("The user could not be found or the user has not personalized this page");

No comments: