1

I have created a class CustomEditor(inside App_Code folder) which is inherited from Editor class of AjaxControlToolkit.HTMLEditor namespace.

Inside the class I have overridden 2 methods

protected override void FillTopToolbar()
{
TopToolbar.Buttons.Add(new Bold());            
TopToolbar.Buttons.Add(new Italic());
TopToolbar.Buttons.Add(new Underline());
}

protected override void FillBottomToolbar()
{
BottomToolbar.Buttons.Add(new DesignMode());
BottomToolbar.Buttons.Add(new HtmlMode());
}

Now I am using this in an aspx page

<%@ Register Namespace="MyControls" TagPrefix="HTMLEditor"  %>
<HTMLEditor:CustomEditor runat="server" Height="500px" Width="100%" ID="editor" AutoFocus="true" />    

When I run the page I can see the editor successfully, but I want to access it in the designer. I am getting this compile time error - "The type or namespace name 'CustomEditor' does not exists in the namespace .."

I am using visual studio 2012. How can I fix it?

I have checked this thread of yours as well - "Classes residing in App_Code is not accessible" but I didn't find the Build Action property

3
  • Have you declared namespace MyControls in that class file? Commented Jan 13, 2014 at 9:16
  • No. But I am accessing the control like MyControls.CustomEditor Commented Jan 14, 2014 at 4:32
  • Hi Please help me on this Commented Jan 16, 2014 at 5:09

1 Answer 1

1

In your .cs file declare:

namespace MyControls
{
    public class CustomEditor
    {
    ...
    }
}
Sign up to request clarification or add additional context in comments.

2 Comments

The issue got resolved after the class is recreated. Thank you
Yep, stating the obvious, here, now, but you can't reference a namespace/class that doesn't exist... that's why you got the error. @Taosique, great job figuring this out - wasn't obvious until the answer got posted. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.