Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 21, 2012 07:39 PM by dtsob75
Feb 20, 2012 08:51 PM|LINK
I am trying to get the sample page for the Custom Buttons to work (AjaxToolkitSampleSite/HTMLEditor/OtherSamples/EditorWithCustomButton). I dropped the sample code into a Web app project, then added the App_Images, App_Code, App_Scripts in to the app, in
addition to the page. When I try to run it, I get a compile error:
The type or namespace name 'Samples' does not exist in the namespace 'AjaxControlToolkit.HTMLEditor' (are you missing an assembly reference?)
It runs in a web site project, just not in a web application project.
I have tried several things, but nothing seems to work. Any ideas?
Feb 20, 2012 10:58 PM|LINK
If you double click on the error in the error window does it take you to a using (c#) or imports (vb) statement. It might be a namespace used in the sample application you did create in your project. If that is the case you could comment out the line of
Feb 21, 2012 02:13 AM|LINK
Do the online examples of Editor work for you?
Are you sure that you use the latest version of Toolkit' DLL in your BIN folder?
Feb 21, 2012 12:52 PM|LINK
Yes, it takes me to the Using, but when I remove that line, I get an error in the code behind that the control does not exist.
Feb 21, 2012 12:55 PM|LINK
The sample works fine, as long as it is used in the web site project. It is only when I add the source to a web application project that I have the problem. I think it may be that I need a Register directive, but I can't seem to hit on the proper syntax.
Since the Custom editor example does not use a user control, it does not like the src option. And, any other combination that I have used seems problematic.
Frustrating. This should be (and probably is) so simple.
Feb 21, 2012 07:39 PM|LINK
An update on this. I have it working, if I use a placeholder on the webpage and then create and add the my customized editor to the placeholder controls collection. I have been playing with different combinations of attributes for the Register directive,
but nothing works.
I have the extended editor class and the customized button classes within my web app project. So I use the namespace of the project, plus the folder name (I am using a sub folder named "Classes" to hold those classes.). When I create a directive like:
<%@ Register Namespace="HTMLEditorPrototype2.Classes" TagPrefix="SimpEd" %>
and the create the control in the aspx file:
<SimpEd:SimpleEditor id="TestEd" runat="server"></SimpEd:SimpleEditor>
I get an error that says Unknown server tag "SimpEd:SimpleEditor"
Does that point to anything I am missing?