set TextAreaFor as Html Editor in asp.netMVC

May 24, 2012 at 9:47 AM
Edited May 24, 2012 at 9:48 AM

HI ,

      I am setting textareafor as HTML Editor in Asp.net MVC As following But i am getting some error.

I got visualize of HTML editor but when i am trying to click any toolbar item ,I am getting

following error.

Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLDocument.execCommand]

I had implemented following way.

<script src="../../Scripts/jHtmlArea-0.7.0/scripts/jHtmlArea-0.7.0.js" type="text/javascript"></script>

<script src="../../Scripts/jHtmlArea-0.7.0/scripts/jHtmlArea-0.7.0.min.js" type="text/javascript"></script>

<link href="../../Scripts/jHtmlArea-0.7.0/style/jHtmlArea.css" rel="stylesheet" type="text/css" />
<link href="../../Scripts/jHtmlArea-0.7.0/style/jHtmlArea.Editor.css" rel="stylesheet"
    type="text/css" />

<style type="text/css">
    div.jHtmlArea .ToolBar ul li a.custom_disk_button
{
    background: url(images/disk.png) no-repeat;
    background-position: 0 0;
}
</style>

$("#User_Address").htmlarea({
            toolbar: [
                            ["bold", "italic", "underline"],
                            ["p", "h1", "h2", "h3"],
                            ['HorizontalRule', 'justifyleft', 'justifycenter', 'justifyright']
                    ],
            css: '../../Scripts/jHtmlArea-0.7.0/style/jHtmlArea.Editor.css'
        });

 @Html.TextAreaFor(m => m.User_Address)