HTML Editor for ASP.NET AJAX
ContextChanged Property
Server ReferenceWinthusiasm.HtmlEditorHtmlEditorContextChanged
The name of a JavaScript function on the page to call when the editor designMode context changes.
Declaration Syntax
C#
public string ContextChanged { get; set; }
Remarks
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.
Examples
Set the property declaratively in the HtmlEditor tag:
CopyC#
ContextChanged = "MyContextChangedHandler"
Page JavaScript function:
CopyC#
function MyContextChangedHandler(editor, context)
{
    var myControl = $get("MyControlID");
    var enabled = false;    

    if (context && context.parentElement)
    {
        enabled = context.parentElement.tagName.toLowerCase() == "a";
    }

    myControl.disabled = !enabled;
}

Assembly: Winthusiasm.HtmlEditor (Module: Winthusiasm.HtmlEditor) Version: 2.3.0.0 (2.3.0.0)