views:

113

answers:

2

I am working on a school project that uses ASP.NET. I found this TextEditor control ( http://blogs.msdn.com/kirti/archive/2007/11/10/rich-text-editor-is-here.aspx ) that I am trying to include but it isn't working.

The error I am getting is: Error Rendering Control - TextEditor. An unhandled exception has occurred. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index.

I see this error when I go Design part of the editor. I just don't understand this error at all. Also I am a lil bit confused as there is no parameter called index. :(

What I have done is reference the binary in my project and then on the page I am trying to use it have registered its namespace and assembly with this line:

<%@ Register Assembly="RichTextEditor" Namespace="AjaxControls" TagPrefix="rtt" %>

I then go ahead and try to add the control to the page with this line of code:

<rtt:richtexteditor ID="TextEditor" Theme="Blue" runat="server" />

Any help would be much appreciated. I haven't done anything like add a custom control before.

+8  A: 

That project has been dormant for 2 years.

That is a lifetime in web years. You will be damning yourself to a life of pain and frustration if you adopt this component into your project, as you are getting a small taste now.

The best advice I can give you is to select another of the multitude of RTE that are active.

Among the most popular/active are

Sky Sanders
Agreed. If you're using *any* custom control developed by someone, and it's throwing exceptions out of the box for a normal usage scenario, then find a new solution. The "Index was out of range" exception is probably being caused by them doing some bad math regarding the selected portion of the text, or where the cursor is. They have an off by 1 error that is putting them at index -1, when 0 would be the correct number. Just a guess...
Samuel Meacham
+1  A: 

The control you're trying to use is buggy, and several people on that project's website have complained about the same issue. You can work around it, though, by not using the "Themes" attribute.

See this post (http://rte.codeplex.com/Thread/View.aspx?ThreadId=36445) for instance. There are others, too.

This is just a guess, but maybe it can't find the theme (in your case, "Blue") for whatever reason and that's just a bad way of announcing this fact. At least, it is an avenue for investigating.

Scott Stafford