Export (0) Print
Expand All

AssetUrlSelector.DefaultOpenLocationUrl property

Gets or sets the URL to a location in this site collection to add to the top of the Look In section of the Asset Picker dialog box.

Namespace:  Microsoft.SharePoint.Publishing.WebControls
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

public string DefaultOpenLocationUrl { get; set; }

Property value

Type: System.String
Defaults to an empty string.

This URL should begin with either "~SiteCollection/" or "~Site/" followed by the URL relative to the desired SharePoint site location. If this URL refers to a valid SharePoint location and one of the authoring users has permission to access it, it is displayed in the Look In section on the left side of the Asset Picker dialog box.

When DisplayLookInSection and DefaultToLastUsedLocation are both set to false, the DefaultOpenLocationUrl property has a valid location, and there is no current AssetUrl property, the Asset Picker dialog box opens in this location and does not display any other locations on its left side. This behavior encourages the user to select a URL from the provided location.

// These values control the appearance and behavior
// of the Asset Picker dialog box.
private const string SampleDefaultOpenLocationUrl = "~Site/Pages/";

// Set values for the appearance and behavior of the Asset Picker dialog box.
   assetSelector.DefaultOpenLocationUrl = SampleDefaultOpenLocationUrl;
Show:
© 2015 Microsoft