Howto: insert a custom image/button in the toolbar and capture the command event in C# codebehind?

  •  09-02-2004, 1:44 PM

    Howto: insert a custom image/button in the toolbar and capture the command event in C# codebehind?

    Hi.

     
    Doubt 1: Can´t insert and image/button in the CE toolbar:
     

    System.Web.UI.WebControls.Image myImg = new System.Web.UI.WebControls.Image();

    myImg.ImageUrl = "~/CuteEditor_files/myImg.gif";

    myImg.Attributes.Add("onclick","MyMethod()");

    myImg.Attributes.Add("type","btn");

    Editor1.RegisterCustomButton(myImg);

     
    Results: The image doesn´t appear in the Editor1 Toolbar
     
    Doubt 2: Suppose I have a method in my .cs file called
     
    private void MyMethod()
    {
        DoSomething...
    }
     
    Task: How to call MyMethod() considering Doubt1 is solved?

    Regards,
    »»» KenA
View Complete Thread