tags:

views:

249

answers:

5

Hello

I was wondering if you guys know a good wysiwyg editor to use with asp.net mvc? I've been looking on the Telerik Editor and it seems really nice.

Which ones do you guys recommend using with asp.net mvc? or will any work in views as with "regular" asp.net

Best regards

/M

A: 

I've used Xinha with MVC, and it's pretty good. Pretty much all of them work with any standard HTML "textarea", so they'll be broadly applicable to any application/framework/language. Xinha does have some features that assume the availability of PHP, but works well enough without them.

GalacticCowboy
You said, "pretty much all of them work with any standard HTML textarea". How do they work: do they depend on whatever support for "contentEditable" may be built-in the end-user's browser?
ChrisW
You create <textarea /> elements and then either tell the editor the id of your textarea (explicit registration) or to just load into any textarea on the page.
GalacticCowboy
Yes, that is how to use them. I was wondering how they implement themselves: whether they depends on the browsers' support for "contentEditable".
ChrisW
@ChrisW - it depends on the editor - some (like TinyMCE - as used here on SO) will present the text area as is, and use script to show a preview as you type, others will replace the textarea with something else - the general approach is you put a textarea on the page with an ID, and then configure the editor script to use that text area, and it does whatever it does.
Zhaph - Ben Duguid
+2  A: 

Any WYSIWYG editor will work, provided it doesn't require runat="server" or viewstate.

25 Useful WYSIWYG Editors Reviewed
http://www.smashingmagazine.com/2008/05/06/25-wysiwyg-editors-reviewed/

The Telerik editor looks fine, although it doesn't look like you can buy it separately. I would check with them for ASP.NET MVC compatibility.

Robert Harvey
A: 

I'd look into Tiny MCE and how it's incorporated into the Code Camp Server project.

Chris Missal
+4  A: 

I have had good luck using jQuery and the jHTMLArea WYSIWYG editor nice and simple.

All you have to do to implement it is:

 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
<script type="text/javascript" src="scripts/jHtmlArea-0.6.0.min.js"></script>
<link rel="Stylesheet" type="text/css" href="style/jHtmlArea.css" />

<textarea id="htmlEditor" cols="50" rows="15">This is some text for editor</textarea>

<script type="text/javascript">
    $(function() {
      $("htmlEditor").htmlarea();        
    });
</script>
CmdrTallen
A: 

MS recently added an HTML Editor control to the ASP.NET AJAX Toolkit, and the latest drop of the Script Files Only package (ideal for use in ASP.NET MVC) on CodePlex contains nicely minified versions of the scripts as well.

Zhaph - Ben Duguid