IPersonalizable::Load Method (PersonalizationDictionary^)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Loads custom data into a control.

Namespace:   System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

void Load(
	PersonalizationDictionary^ state
)

Parameters

state
Type: System.Web.UI.WebControls.WebParts::PersonalizationDictionary^

A PersonalizationDictionary that contains custom scoped data that was loaded from the underlying data store.

This method is called on a control to allow it to load custom data into itself. It can also return a value that indicates whether a control's custom state must be written back to the underlying data store, regardless of whether any other personalization data on the page has changed. A control can set its own custom properties and carry out additional internal logic based on the values contained in the personalization dictionary. This method is called by the Web Parts control set while applying personalization data to a control.

You should also be aware of the merge behavior of User-scoped versus Shared-scoped properties contained in the PersonalizationDictionary object. The state parameter contains a merged representation of custom data that was loaded from the underlying data store. In Shared scope, all the values that were previously added when the page itself was in Shared scope would be available. In User scope, if a value associated with User personalization scope had one value added when the page was in Shared scope, and a different value when the page was in User scope, then the personalization infrastructure would only include the User-scoped value (as opposed to the Shared scope value) within the state parameter.

The following code example demonstrates an implementation of the Load method in a custom WebPart control. For the full code required to run this example, see the Example section in the IPersonalizable class overview.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: