Tuesday, 3 November 2009

Using the Ajax HTMLEditor 'Lite top toolbar' sample with VB.net

I thought I'd share this as it took some time for me to work this one out.

I wanted to use the AJAX Control Toolkit HTML Editor, but wanted less functionality than the standard implementation. In fact, the Lite top toolbar without bottom toolbar was what I wanted.

To do this you need to copy the HTMLEditor.Samples.cs into your App_Code directory. You'll find it in Ajax Control Toolkit\SampleWebSite\App_Code\.

If, like me, you use VB rather than C#, then you'll need to convert it. I did this using the amazing tool at developerfusion.com. Obvisously, change the file extension to .vb too.

Then at the top of your aspx page you need to register it:
<%@ Register
Namespace="AjaxControlToolkit.HTMLEditor.Samples" %>
I'm assuming here that you've already used the AjaxControlToolkit in your project, otherwise you'll have to register the main assembly too.

And finally you can add your control like so:
<customEditors:LiteNoBottom ID="myEditor" runat="server" Height="300px" Width="100%" TabIndex="2" NoScript="true" NoUnicode="true" />
Works for me!



    I never would have figured this out and you made it easy!!!

    Thanks Dude!

  2. I was only able to get this to work once I included HTMLEditor.CustomButtonsAndPopups.cs as well as specified the Assembly in the Register tag at the top of the page. Without those additions, I receive compile errors and parse errors on the ASPX markup.

    Great post and thank you!


Comments are moderated, so you'll have to wait a little bit before they appear!