Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Ajax control toolkit custom htmleditor save button

$
0
0

Hi,

I have a created a custom editor using ajax control toolkit htmleditor. In the bottom toolbar I want to add a save and cancel button instead of the standard buttons and want to add a server-side event handler to these buttons. I  did create the buttons using methodbutton like this (see below) in CustomEditor.cs, but cannot figure out how to add server-side event handler to the button click events? Can you please help me? I'm struggling for few days now to achieve this :(

        protected override void FillBottomToolbar()
       {
            //BottomToolbar.Buttons.Add(new HtmlMode());
            AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton btnSave = new AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton();
            btnSave.NormalSrc = "images/icon_save.gif";
            btnSave.Attributes.Add("onclick", "saveButtonClicked(); return false;");
            btnSave.Attributes.Add("border", "1");
            btnSave.Attributes.Add("padding", "2px");
            BottomToolbar.Buttons.Add(btnSave);

            AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton btnCancel = new AjaxControlToolkit.HTMLEditor.ToolbarButton.MethodButton();
            btnCancel.NormalSrc = "images/icon_save.gif";
            btnCancel.Attributes.Add("onclick", "alert('Cancel');");
            btnCancel.Attributes.Add("border", "1");
            btnCancel.Attributes.Add("padding", "2px");
            BottomToolbar.Buttons.Add(btnCancel);
       }

Thanks in advance!


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>