tekk

tekk

  • NA
  • 101
  • 0

Custom Html Editor control Id did not getting in aspx.cs page

Jun 3 2010 5:13 AM
hi friends,
               My Problem is am not getting customhtmlEditor control ID in aspx.cs page, its getting error like:The Name "Editor1" does not exist in context.
 AM using VS 2008, Asp.net version 2.0 and my application is Web Appliaction Project.

My Code Here:

    I created custom HtmlEditor control using class file, here code

using AjaxControlToolkit.HTMLEditor;

namespace VMS.App_Code
{
    public class customEditor : Editor
    {
        public customEditor()
        {
        }

        protected override void FillTopToolbar()
        {
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.Bold());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.Italic());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.Copy());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.Cut());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.BulletedList());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.FixedBackColor());
            TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.FontSize());
        }

        protected override void FillBottomToolbar()
        {
            BottomToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.DesignMode());
            BottomToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.PreviewMode());
        }
    }
}

and register in .aspx Page like following:

<%@ Register Namespace="VMS.App_Code" TagPrefix="custom" %>

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <custom:customEditor ID="Editor" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
 

Please Help me,
In advance Thanks,

Tekk

Answers (13)