AssetUrlSelector.MaxLength property

Gets or sets the maximum character length for the asset URL text box.

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

public int MaxLength { get; set; }

Property value

Type: System.Int32
Defaults to a value of 0, which indicates unlimited character length.
The maximum character length for the Asset URL text box or 0 to indicate no limit.

When this property value is set to a value greater than 0, the HTML input text box does not allow input greater than the specified character length and the posted value is validated to ensure that it does not exceed that length. This property has no effect if the AssetUrlTextBoxVisible property is set to false.

// These values control the appearance of the text box
// and button for the control.
private const int SampleMaxLength = 100;
// Set values for the behavior and validation// for the text box.assetSelector.MaxLength = SampleMaxLength;