I think I found a solution for what I need. You can continue to override the built-in New button as in my first example, but then just call your editor1.ExecCommand("New"); javascript. I resolved my one issue above by just creating an additional argument to my javascript function for the Editor Client ID property. Now this way it can be dynamic, I can continue to add my other controls dynamically, and the javascript function itself becomes dynamic. This also means that you could potentially use the same javascript function for different buttons, links, or images on the form.
The code is shown below. I could easily make the javascript more diverse by putting in additional 'if' statements to test what button was pushed and respond to each one individually providing unique results.
The following code snippets prompt the user to verify that they really want to clear the document. If they do, then it will clear the document using the Cute ExecCommand javascript function. If they don't want to clear it, the function exits and does nothing.
The following Javascript goes into your html.
function ConfirmWindow(strDialogMessage,EID){ var strMessage; var intResponse; intResponse = confirm(strDialogMessage); if (intResponse == 1) { // get the cute editor instance var editor1 = document.getElementById(EID); editor1.ExecCommand("New"); return true; } else { return false; } }
The following code goes in your vb code-behind page...
CType(oCuteEditor.ToolControls("New").Control, System.Web.UI.WebControls.WebControl).Attributes.Add("onclick", "return ConfirmWindow(""Are you sure you want to clear this email??\nSelect 'OK' to delete or 'Cancel' to quit."",'" & oCuteEditor.ClientID & "');")