Share via


AssetUrlSelector.ButtonType Property

Gets or sets the style for the Asset Picker button.

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

Syntax

'Declaration
Public Property ButtonType As ButtonType
    Get
    Set
'Usage
Dim instance As AssetUrlSelector
Dim value As ButtonType

value = instance.ButtonType

instance.ButtonType = value
public ButtonType ButtonType { get; set; }

Property Value

Type: System.Web.UI.WebControls.ButtonType
Either ButtonType.Image or ButtonType.Button.

Exceptions

Exception Condition
InvalidOperationException

The value set in this property is not ButtonType.Image or ButtonType.Button, or else the property was set after child controls were already created.

Remarks

If set to ButtonType.Image, you can use the PickerButtonImage property to specify the URL for the button image. This property has no effect if the AssetPickerButtonVisible property is set to false.

Examples

// These values control the appearance of the text box
// and button for the control.
private const bool SampleAssetPickerButtonVisible = true;
private const ButtonType SampleButtonType = ButtonType.Image;
private const string SamplePickerButtonImage = "/_layouts/images/icdoc.gif";
private const string SamplePickerButtonText = "Sample Button Text";
// Set values for the appearance of the text box and // button for the control.assetSelector.AssetPickerButtonVisible = SampleAssetPickerButtonVisible;assetSelector.ButtonType = SampleButtonType;assetSelector.PickerButtonImage = SamplePickerButtonImage;assetSelector.PickerButtonText = SamplePickerButtonText;
' These values control the appearance of the text box
' and button for the control.
Private Const SampleAssetPickerButtonVisible As Boolean = True
Private Const SampleButtonType As ButtonType = ButtonType.Image
Private Const SamplePickerButtonImage As String = "/_layouts/images/icdoc.gif"
Private Const SamplePickerButtonText As String = "Sample Button Text"

' Set values for the appearance of the text box and 
' button for the control.
assetSelector.AssetPickerButtonVisible = SampleAssetPickerButtonVisible
assetSelector.ButtonType = SampleButtonType
assetSelector.PickerButtonImage = SamplePickerButtonImage
assetSelector.PickerButtonText = SamplePickerButtonText

See Also

Reference

AssetUrlSelector Class

AssetUrlSelector Members

Microsoft.SharePoint.Publishing.WebControls Namespace

AssetUrlSelector