Share via


The PartStorage Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The best place to store customization information related to a Web Part is in the PartStorage property, which you can access through the Digital Dashboard Services Component. For more information about the Digital Dashboard Services Component, see the Digital Dashboard Services Component reference documentation.

In the following example, the script in an HTML Web Part tracks the user's name and address, so it can be retrieved the next time the users accesses the dashboard. The dashboard**stores these values in custom properties using the State Management service of the Digital Dashboard Services Component. The Web Part specifies the namespace and name for each property, in addition to the value for each property. Later, the Web Part can retrieve this state information through the Properties collection.

The following is the content of the Web Part. Note that the Web Part uses the string 'This_WPQ_Part' to reference itself. For more information on the string '_WPQ_Part', see the "Part Discovery Service" section of the Digital Dashboard Services Component reference documentation.

<TABLE border=0 cellPadding=1 cellSpacing=1 style="HEIGHT: 228px; WIDTH: 415px" width="75%">
  <TR>
    <TD>Name:</TD>
    <TD><INPUT id=txtName name=text1 style="HEIGHT: 22px; WIDTH: 278px"></TD></TR>

</TABLE>
</P>
<INPUT id=load type=button value="Remember Me" LANGUAGE=javascript onclick="load_onclick();">
<INPUT id=save type=button value="Place Order" LANGUAGE=javascript onclick="save_onclick();">
<SCRIPT LANGUAGE=javascript>
function save_onclick() {
this_WPQ_Part.Properties ("urn:Custinfo#CustName", txtName.value, 0);
this_WPQ_Part.Properties ("urn:Custinfo#CustName ", txtAddress1.value, 0);
this_WPQ_Part.Properties ("urn:Custinfo#Address2", txtAddress2.value, 0);
this_WPQ_Part.Properties ("urn:Custinfo#City", txtCity.value, 0);
this_WPQ_Part.Properties ("urn:Custinfo#State", txtState.value, 0);
this_WPQ_Part.Properties ("urn:Custinfo#Zip", txtZip.value, 0);this_WPQ_Part.Save()
}
function load_onclick() {
txtName.value = this_WPQ_Part.Properties("CustName");
txtAddress1.value = this_WPQ_Part.Properties ("urn:Custinfo#Address1");
txtAddress2.value = this_WPQ_Part.Properties ("urn:Custinfo#Address2");
txtCity.value = this_WPQ_Part.Properties ("urn:Custinfo#City");
txtState.value = this_WPQ_Part.Properties ("urn:Custinfo#State");
txtZip.value = this_WPQ_Part.Properties ("urn:Custinfo#Zip");
}
</SCRIPT>

See Also

Developing a Digital Dashboard Using Web Parts | Guidelines for Building Good Web Parts | The CustomizationLink Property | Cookies | Cookies and Non-Isolated Content