Creates a JavaScript command as a String that, when executed on the client triggers the ExternalCallback event using callback.

Namespace: Reimers.Google.Map
Assembly: Reimers.Google.Map (in Reimers.Google.Map.dll) Version: 5.3.95.699 (5.3.95.699)

Syntax

C#
public string CreateMapCallback(
	string argument,
	bool isArgumentScript
)

Parameters

argument
Type: System..::..String
The argument to pass to the ExternalCallback event.
isArgumentScript
Type: System..::..Boolean
Sets whether the argument is created using a clientside script.

Return Value

A JavaScript command as a String.

Remarks

This method creates a JavaScript command that must be sent to a method that executes it. Merely executing the method does not produce any results.

If the isArgumentScript is set to false the message box will simply display "new Date()".

Examples

The following code shows how to pass the present date and time to the ExternalCallback event after rendering the map. The serverside event handler in turn returns a command that displays it in a messagebox.

CopyC#
Map.PostRenderScript = Map.CreateMapCallback("new Date()", true);
Map.ExternalCallback += new ExternalCallbackHandler(Map_ExternalCallback);
void Map_ExternalCallback(string argument, ref string MapCommand)
{
    MapCommand = "alert('" + argument + "');";
}

See Also