gyansangrah
gyansangrah

Reputation: 21

Issue in accessing class from App_Code

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

Upvotes: 1

Views: 281

Answers (1)

ttaaoossuu
ttaaoossuu

Reputation: 7884

In your .cs file declare:

namespace MyControls
{
    public class CustomEditor
    {
    ...
    }
}

Upvotes: 1

Related Questions