Click here to Skip to main content
Click here to Skip to main content

Beginners introduction to the Jiffycms HTML Editor

By , 22 Mar 2009
 

Introduction

One of the things you will notice in ASP.NET today is that, by default, out of the box, there is no standard control representing a rich text editor. You will also notice that your only viable options are quite limited to:

  • FREETEXTBOX --while the name suggests it's free, what is free is only a subset of features, while the full version is on a pay basis.
  • FCKEditor --This is the most highly used editor in the market today due to it being Open Source; however, mainly it's just a client-side product with several contributors having written server-side wrappers around the client-side library. The problem with this though is that the web control is simply a wrapper.
  • You purchase a commercial license from third parties (quite pricey).

Jiffycms HTML Editor is a rich text Open Source HTML editor with commercial grade features, and is a great alternative to all three points above. It's written for ASP.NET, and uses ASP.NET AJAX Extensions to the full potential. It is also a rich server-side Web control requiring you to make very little effort to get it running as it uses the VS.NET designer at full potential too. There are just too many features, and to list each here is not going to be possible; instead, this article will focus on first time usage, and specifically how to move the CSS generated by the WebControl to an external CSS file.

Unlike most HTML editors, Jiffycms HTML Editor is a true Web Control without any extra dependencies, and is packaged as a single DLL. Since it is built on top of the AJAX Extensions library, which many people are already referencing in their pages due to their using the UpdatePanel or what not, the payload in the client library download size is minimized: something which you will incur on other third party editors out there today since they tend to use their own custom libraries.

Here in this post, I want to showcase how easy it is to use the Jiffycms HTML Editor in your pages and how to perform some optimizations to get the best performance from your web apps by using an external CSS stylesheet file.

Usage

First, let's try to start from the basics and define a new WebSite Project for the purposes of this tutorial:

Create new project VS.NET

Let's now download the Jiffycms HTML Editor DLL from CodePlex. Now that we have the DLL, which is Jiffycms.Net.Toolkit.dll, we are ready to add it to our Toolbox in VS.NET. Before you add it to your Toolbox, to help you in better organizing all your custom controls, you may want to create a new tab in the toolbox first and then add the control in there.

Add new tab in VS.NET Toolbox

Now, right click into your newly created tab empty area, and select "Choose Items" from the context menu. You can also simply drag and drop the DLL into the empty area.

Choose Items context menu

Browsing for Jiffycms HTML Editor dll

When you are done browsing to the DLL you downloaded from CodePlex, you should see it in your toolbox at this point, and you are ready to start using this fine component.

Jiffycms HTML Editor icon in toolbox

While you may not like working in Design view in VS.NET, dragging and dropping the control from the Toolbox onto your web form is going to allow the editor to make the initial configs in your web.config file automatically. The registrations it makes can be made manually, it's just a registration for a simple HttpHandler in web.config.

If you prefer to do this manually, then make the following entry under the path Configuration/httpHandlers section; for IIS 6, this is as follows:

<add verb="*" path="jiffycms.axd" 
     type="Jiffycms.Net.Toolkit.WebResourceHandler" />

For IIS 7, you need to make an entry under the Configuration/system.webServer/Handlers section, as follows:

<add verb="*" path="jiffycms.axd" name="WebResourceHandler" 
  type="Jiffycms.Net.Toolkit.WebResourceHandler" 
  preCondition="integratedMode" />

Note: If you are dragging and dropping the component from the Toolbox, this is already done for you.

After dragging and dropping the control at Design time, this is what the HTML editor looks like in Design view:

Jiffycms HTML Editor in designview

Oh great, we got design-time rendering of the editor. Now, it's a matter of playing with the various properties in the property grid. Upon running the page, you will notice lots of CSS output in the head section of your rendered page. While this is the default, you can chose to put the CSS in an external CSS file. Doing this will not only decrease the page payload, but since the CSS is in an external CSS file, it will get cached by the browser, so that subsequent requests will be served from the cache automatically.

Fortunately, this kind of change is not hard to do. You can use a design-time feature to collect all the runtime CSS generated by the control and manually copy it into an external CSS file.

CSS extraction tool

Just copy the CSS and paste it into an external style sheet, then reference the CSS file via the ExternalStyleSheet property:

Map external stylesheet to ExternalStyleSheet property

Note that every time you make a modification to the editor such as modify the styles in the designer or modify style dependent properties such as IconsMode, ToolbarMode etc., you will need to regenerate the CSS and update your CSS file manually. Fortunately, if you have decided to go this route, you might also be editing the CSS yourself so this may not be an inconvenience after all.

History

Update: 22 - March - 2009

A new article is now available dealing with the Image Gallery in Jiffycms HTML Editor.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Alessandro Zifiglio
Web Developer Typps.com
Italy Italy
Member
I'm alessandro and currently run www.typps.com

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
SuggestionNeed ValidationmemberSubhankar Chatterjee30 Nov '12 - 20:09 
I want to add validation to the Jiffycms HTML Editor. Please help
QuestionSet Html Textmembersamoraie31 Jul '11 - 2:59 
How I can set html text in editor with asp.net?
GeneralUpdate panelmembermikyduke1 Jul '09 - 23:21 
if inside the control in update Panel the control not work and have javascript error. there is a solution for this? tnx
GeneralRe: Update panelmembermikyduke2 Jul '09 - 3:07 
sorry the porblem is not whit upadetepanel, the problem is when the control is inside in formview.
have the fix?
GeneralRe: Update panelmemberAlessandro Zifiglio19 Oct '09 - 11:34 
Apologies for late reply. This type of problems need to be reported on the forum[^] because it's more convenient for me and others to have a central place to search for common problems and solutions and discuss. Most of all, it's easier for me   That said, try with the latest version,...
GeneralProblem in IE 6memberpravin_kumaram3 Jun '09 - 22:19 
In Firefox every thig is cool but when I open it in IE 6 toolbar and footer tabs are not visible   Every thing is number
GeneralRe: Problem in IE 6memberAlessandro Zifiglio19 Oct '09 - 11:43 
hi, late response, I apologize for this. I hardly check up on codeproject due to lack of time, but in case others are asking themselves the same question allow me to make you a belated response. You are correct. IE6 was not a supported browser in the initial version. I was really hoping for IE6...
GeneralRightmousclick - properties images, hyperlinks -membernlaban2 Jun '09 - 21:34 
Did a quick look at the editor. One of the things I like from fckeditor and can't find with jiffycms is the rightmouseclick on a image and/or hyperlink, where in fckeditor popup's options for properties and change for current object.   so far.   regards from the Netherlands.
GeneralFantasticmemberThanigainathan.S31 May '09 - 20:11 
Hi,   Your article is nice. The tool is very good.   Thanks, Thani   India is Mythical and so we are
GeneralLicence RestrictionsmemberWhitecatSolutions8 Apr '09 - 5:14 
Hi all,   Do you know if there are there any license restrictions on using this is opensource product in websites that I develop for my clients.   Regards   ScottyB
GeneralRe: Licence Restrictionsmemberzlezj31 May '09 - 11:39 
According to http://jiffycms.codeplex.com/license[^] it is GPLv2, so there are restrictions.
GeneralRe: Licence Restrictionsmembercorefour2 Jun '09 - 8:06 
I wonder if the licensing could be clarified?   On the website at http://www.jiffycms.net/Forum/ShowPost/6/JiffyCms-Support.aspx a user asks:   "Also, I am confused about the purchase page. Would I need to purchase one of the licenses to use the Html Editor in a corporate...
GeneralRe: Licence Restrictionsmemberzlezj2 Jun '09 - 10:51 
First of all: I'm not an expert on licensing matters.   Take a look at http://developer.kde.org/documentation/licensing/licenses_summary.html[^] for a comparison of licenses and draw your own conclusions.
GeneralRe: Licence Restrictionsmembercorefour2 Jun '09 - 11:03 
Yes, that writeup confirms my impression. I would be most interested in hearing what alessandro says about it, because his reply to the question about using it for corporate software indicates that the software if free to be used for such purposes, whereas of course a high percentage of software...
GeneralRe: Licence Restrictionsmemberzlezj2 Jun '09 - 11:36 
If he want to change the license, there are many alternatives[^] to choose from...
GeneralRe: Licence RestrictionsmemberAlessandro Zifiglio3 Jun '09 - 10:05 
hello, apologies for late reply. The question you are referring to was with regard to Jiffycms which is a separate product. Jiffycms is a content management system I have written as a commercial product that uses "Jiffycms *HTML Editor*". Perhaps I should find a name for the Editor since it's...
GeneralRe: Licence Restrictionsmembercorefour6 Jun '09 - 6:11 
Thanks for the reply Alessandro. In my case and probably for many others, I can't even begin to consider this HTML editor for any of my projects, which are typically small scale custom apps created for various organizations. Just about all of my applications involve some specialized business...
GeneralProblem: Getting the Control to WorkmemberTL Wallace1 Apr '09 - 7:51 
I couldn't get it to work. First - (Run) Created a website Created Usercontrol WebUserControl.ascx Dropped the control onto WebUserControl.ascx Dropped the WebUserControl.ascx onto Default.aspx Dropped ScriptManager onto Default.aspx Pressed Save button - nothing happended Pressed view...
GeneralRe: Problem Solved w/Reservation [modified]memberTL Wallace1 Apr '09 - 7:59 
Never mind this article helped Setting up an image gallery in Jiffycms HTML Editor[^]   Required Page Declaration:   "ValidateRequest="false"   However I do have some reservations with it after reading the article: Request Validation - Preventing Script Attacks ...
GeneralRe: Problem Solved w/ReservationmemberAlessandro Zifiglio3 Apr '09 - 10:20 
hi wallace, sorry for delayed response. Request validation in asp.net is quite a general purpose functionality that blocks everything without discrimination. In case where you want to expose an HTML editor, you expect HTML input so you'll need to enable on those specific pages and handle the...
GeneralWishlist and a problemmemberGfw1 Apr '09 - 1:00 
As I mentioned in a previous post - great control.   My wish list...   New Document Button that would clear all editor content. If I use a button outside the editor and set Editor1.Text = string.Empty the original value is retained on postback.   Font Size selector would...
GeneralRe: Wishlist and a problemmemberAlessandro Zifiglio3 Apr '09 - 10:31 
hi Gfw, sorry for the delayed response. Your suggestions are good improvements and they address some of the short comings of the control. I will try to add them soon. As for the value of the textbox not clearing in your situation, I confirm that this is a bug, I shall fix it soon too.  ...
QuestionCant Get the control to workmemberOferBNI29 Mar '09 - 22:40 
I try to test the control in a new web site project (VS2008). I added a reference to the dll i downloaded. Wrote the code below. Run the project. The IE with the html editor appears. wrote couple of lines in the editor and hit the view HTML tab. Nothig happes. What is missing or what i'm...
GeneralDang fine work sir!memberB4bb4g325 Mar '09 - 1:10 
Fantastic stuff, thats fitted right in with something im doing here far better than our current home grown solution and a couple of other similar things we tried online.   Many thanks for putting it out for all to use   Martin
GeneralRe: Dang fine work sir!memberFilip C25 Mar '09 - 1:13 
indeed, awesome work dude!   Defcon

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 22 Mar 2009
Article Copyright 2009 by Alessandro Zifiglio
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid