Share via


AssetUrlSelector.ClientCallback property

Gets or sets a client ECMAScript (JavaScript, JScript) string that specifies a function to call when the Asset Picker dialog box returns a value.

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

Syntax

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

value = instance.ClientCallback

instance.ClientCallback = value
public string ClientCallback { get; set; }

Property value

Type: System.String
A string; the default is an empty string.

Remarks

If this property is set to a value, the value is emitted into the registered client ECMAScript (JavaScript, JScript) for this control and the application uses the client value of this ECMAScript (JavaScript, JScript) to specify the callback function for the Asset Picker dialog box. This client callback function is called after the Asset Picker dialog box returns a value and the returned URL and default text are stored in any HTML elements specified by AssetUrlClientID and AssetTextClientID. This ClientCallback property is called whether the Asset Picker dialog box is opened by using an Asset Picker button or from ECMAScript (JavaScript, JScript) retrieved by the GetClientLaunchPickerReference method. If the AutoPostBack property is set to true, the AutoPostBack happens after the call to the ClientCallback function is complete.

The string for this property can be the name of an appropriate ECMAScript (JavaScript, JScript) function available in the page, a global variable with an appropriate function reference stored in it, or an explicitly defined anonymous ECMAScript (JavaScript, JScript) function string such as the following.

function(newAssetUrl, newAssetText, configObject, returnValue)
{
//Perform client side script operations with the new asset URL value
}
// Set the ECMAScript to perform after populating the text boxes with the returned values.assetSelector.ClientCallback = ScriptClientCallback;
Private Function [function](ByVal newAssetUrl As String, ByVal newAssetText As String, ByVal configObject As Object, ByVal returnValue As String) As String
 'Perform client side script operations with the new asset URL value
End Function
' Set the ECMAScript to perform after populating the text boxes with the returned values.
assetSelector.ClientCallback = ScriptClientCallback

See also

Reference

AssetUrlSelector class

AssetUrlSelector members

Microsoft.SharePoint.Publishing.WebControls namespace

AssetUrlSelector