Page.SetObjectScript

Page.SetObjectScript ( 

string ObjectName,

string EventName,

string Script )

Example 1

Page.SetObjectScript("Label1", "On Click", "-- Script removed by action");

Clears out the script from the "Label1" label object's On Click event and replaces it with a comment.

Example 2

-- Get the script from the button's on click event
sPreviousScript = Page.GetObjectScript("Button1", "On Click");

-- Initialize the new script
sNewScript = "Dialog.Message(\"Title\", \"Message\");"

-- Append the new script to the old script
Page.SetObjectScript("Button1", "On Click", sPreviousScript .. "\r\n" .. sNewScript);

Appends a dialog message action to the script existing on the On Click event of the "Button1" button object.

See also:  Related Actions