The name of a JavaScript function on the page to call
when the editor designMode context changes.
| C# |
public string ContextChanged { get; set; }
The client-side editor will call the named JavaScript function on
the page whenever the editor designMode context changes. This allows the
developer to take appropriate action, such as perhaps enabling and disabling
a control on the page based on the parentElement tag of the current context.
Set the property declaratively in the HtmlEditor tag:
CopyC#
Page JavaScript function:
CopyC#
ContextChanged = "MyContextChangedHandler"function MyContextChangedHandler(editor, context)
{
var myControl = $get("MyControlID");
var enabled = false;
if (context && context.parentElement)
{
enabled = context.parentElement.tagName.toLowerCase() == "a";
}
myControl.disabled = !enabled;
}