Run TinyMCE Editor Plugin offline (Without Internet) in ASP.Net

Last Reply 5 months ago By dharmendr

Posted 5 months ago

Hi

I am using below link example in my application.

RichTextBox Example using Free TinyMCE Editor in ASP.Net

When i copy the js from below link and save in application for references instead of online reference it wont works.

Textbox does not aquire editor styling.

<script type="text/javascript" src="https://tinymce.cachefly.net/4.0/tinymce.min.js"></script>

You are viewing reply posted by: dharmendr 5 months ago.
Posted 5 months ago

Hi Waghmare,

To work with offline tinymce requires below files.

tinymce.min.js, skin.min.css, content.min.css, tinymce.ttf and tinymce.woff

The folder structure should be like below.

skins (Folder) -> lightgray (Folder) -> content.min.css (Style Sheet)

skins (Folder) -> lightgray (Folder) -> skin.min.css (Style Sheet)

skins (Folder) -> lightgray (Folder) -> fonts (Folder) -> tinymce.ttf (File)

skins (Folder) -> lightgray (Folder) -> fonts (Folder) -> tinymce.woff (File)

You can get the required file from the below link.

https://getadmissions.com/assets/tinymce/skins/lightgray/

HTML

<asp:TextBox ID="txtTinyMCE" runat="server" TextMode="MultiLine"></asp:TextBox>
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="Submit" />
<hr />
<asp:Label ID="lblContent" runat="server"></asp:Label>
<script src="tinymce.min.js" type="text/javascript"></script>
<script type="text/javascript">
    tinymce.init({ selector: 'textarea', width: 300 });
</script>

C#

protected void Submit(object sender, EventArgs e)
{
    lblContent.Text = txtTinyMCE.Text;
}

VB.Net

Protected Sub Submit(sender As Object, e As System.EventArgs)
    lblContent.Text = txtTinyMCE.Text
End Sub

Screenshot