Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMce using ASP.NET MVC 3 With Razor View Engine - loads but does not display

I have a simple form using the TinyMce jQuery plugin. When I load the page, TinyMce is supposed to replace my textarea with his editor, but this does not happen. Looking at the html generated, my textarea is there (visibility set to hidden) but no iFrame object was created by TinyMce. The TinyMce object exists, but the activeEditor is null. It is as if I have not initialized it, but I am following the sample code exactly as follows:

//here is where I load the scripts

<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.tinymce.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/tiny_mce_jquery.js")"></script>

// here is my text area

<textarea id="tinymceId" name="content" class="tinymce" rows="1" cols="50" style="width:100%;" ></textarea>

//and here is my script code where I initialize it

$(document).ready(function () {
    $('#tinymceId').tinymce({
       doctype: '<!DOCTYPE html>',
       editor_selector: "tinymce",
       convert_urls: false,
       mode: "textareas",
     });
});
like image 442
Laurel Avatar asked Dec 17 '22 09:12

Laurel


1 Answers

Well, the most famous way of being cool nowadays is to use Nuget.

I have written some partial view templates for TinyMCE. (I also push TinyMCE to the feed when it is being updated)

Following article will walk you through for the process :

TinyMCE HTML Text Editior & ASP.NET MVC - Setting It Up Has Become Easy With Nuget

like image 119
tugberk Avatar answered Dec 28 '22 06:12

tugberk