Condividi tramite


WebPart.ExportControlledProperties Property

NOTE: This API is now obsolete.

Gets or sets a value indicating whether a Web Part’s properties that are flagged as controlled properties by the Web Part developer can have their values exported in personal view.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<ObsoleteAttribute("Use ExportMode instead.")> _
<WebPartStorageAttribute(Storage.Shared)> _
Public Property ExportControlledProperties As Boolean
    Get
    Set
'Usage
Dim instance As WebPart
Dim value As Boolean

value = instance.ExportControlledProperties

instance.ExportControlledProperties = value
[ObsoleteAttribute("Use ExportMode instead.")]
[WebPartStorageAttribute(Storage.Shared)]
public bool ExportControlledProperties { get; set; }

Property Value

Type: System.Boolean
true if properties flagged as controlled properties can be exported by individual users in personalization mode; otherwise, false. The default value is false.

Remarks

If the ExportControlledProperties property is true, the Web Part infrastructure allow users with a Web Part Page open in personal view to export properties that are flagged as controlled properties by the Web Part developer. If false, the infrastructure does not export the values of controlled properties.

A Web Part developer can flag properties as controlled properties by setting the ControlledExport property of the WebPartStorageAttribute class for a property to true.

This property cannot be personalized by individual users. The value of its WebPartStorageAttribute is Storage.Shared, which specifies that the property is stored with the same value for all users. Only users with the Write web pages right can set this property. It can be set programmatically, or it can be set through the Web Part task pane in the shared view of the Web-based user interface, or by using a SharePoint Foundation–compatible HTML editor, such as SharePoint Designer.

Examples

Overloads Protected Overrides Sub RenderWebPart(output As HtmlTextWriter)
    ' Check to see if properties marked for controlled export can be exported.
    If Me.ExportControlledProperties = True Then
        output.Write("Properties marked for controlled export can be exported in personal view")
    Else
        output.Write("Controlled export properties can only be exported in shared view")
    End If
 End Sub
protected override void RenderWebPart (HtmlTextWriter output)
{
    // Check to see if properties marked for controlled export can be exported.
     if (this.ExportControlledProperties == true) 
    {
        output.Write ("Properties marked for controlled export can be exported in personal view");
    }
    else 
    {
        output.Write ("Controlled export properties can only be exported in shared view");
    }
} 

See Also

Reference

WebPart Class

WebPart Members

Microsoft.SharePoint.WebPartPages Namespace