Skip to main content

How to setup TinyMCE using ASP.NET (C#) ? How to customize TinyMCE buttons ?

How to setup TinyMCE using ASP.NET (C#) ? How to customize TinyMCE buttons ?

Today we are going to take a look at one of the most customizable Rich Text Editors for Asp.Net – TinyMCE.
How to setup tinyMCE
In this post I will give you couple of tricks how to easily set  it up, customize and avoid most common problems such as “Required Field Validator” and “A potentially dangerous Request.Form value was detected” errors.
Let’s start.

1. First of all download TinyMCE from here:

2. Unpack “tinymce” folder to your Web Project root folder.

(My project is divided into Admin and Member sections, and tinymce is used only Admin that’s why I unpacked it in Admin folder)

3. Now go to the page where you will be using TinyMCE and add following code at the top:

4. Let’s take a look at each line, so you know how to customize your tinyMCE toolbar:

a. mode: “textareas”
– means that it will replace all textareas or
b. theme: “advanced”
      – means that you choose advanced theme
c.  I used “theme_advanced_toolbar_location: 
–  because when I first installed tinyMCE toolbar appeared at the bottom. So to fix it I used theme_advanced_toolbar_location property
d. theme_advanced_buttons1:
       –  describes what buttons will appear on first row of toolbar (theme_advanced_buttons2 and 3 describes second and third rows)
e. encoding: “xml”
– solves  “A potentially dangerous Request.Form value was detected”, which won’t allow you to submit the Web Form
This is all what you need to set up your tinyMCE.
However, there is one more trick that will help you to avoid problem of Required Field Validator saying that your textarea is empty.

5. All you need to do is add following to your textarea or asp:TextBox:

OnClientClick=”tinyMCE.triggerSave(false,true);”
Example:
So here what I got:

Comments

Popular posts from this blog

Top five MLM companies in Pakistan

There are several multi levels marketing (MLM) or direct selling companies in Pakistan since 1999 but some of them are better than the others. We have some big names in the list of MLM companies in Pakistan. These companies are local and international companies and also have a great reputation in the world. Here we are giving some important information about these companies for the people who are searching for their career company in Pakistan. These are the top five MLM companies in Pakistan . These are decided by the top network marketers and by the masters of all kind of marketing in Pakistan. The ELI Enlightenment through learning and implementation (ELI) is one of the best MLM or direct selling company in Pakistan and a pure Pakistani company in the area. This company is working on the educational products. These products are computer courses, ielts, spoken English and some kind of other courses. All courses are in DVD’s. These courses are very expensive in ...

Run Android on Your Computer

Run Android on Your Computer And Run Any VoIP App on It Screenshot of Jar of Beans Android Emulator. by Nadeem Unuth Updated March 20, 2017 There are so many interesting apps there on Android that would be great if you could have them on your computer. There are those games, and there are those communication tools that allow you to save money and to communicate using text, voice, and video. Well, there are things you can do to run VoIP apps like WhatsApp , Viber , WeChat , BBM and all the other apps you find on Google Play on your computer just like you would run them on your Android device. You only have to install software called an Android emulator. It simulates the functions of an Android device on your computer and runs like an operating system within your computer’s operating system.  Your mouse curs...

How to create a contact form with Bootstrap ? (JQuery/PHP/HTML5/JqBootstrapValidation)

How to create a contact form with Bootstrap ? (JQuery/PHP/HTML5/JqBootstrapValidation) ​ How to create contact Form - FREE PDF Code Examples Links to all the resources GIVE ME MY PDF! Hey guys! Today we will talk about such essential feature for any website as contact form. Recently, while working on one of the projects, I had a pleasure combining couple of very nice tools (Bootstrap 3 + JQuery + jqBootstrapValidation), which resulted in minimalistic , but powerful contact form, that would be a good addition to any website. VIEW DEMO            CODE In this post I will walk you through the process of developing this form. Also if you just want to put it in your website, just pulled from my github repo and have fun. Sounds good ? Let’s start. When I was developing my form I had in mind following goals: – Minimalistic design – Track person’s contacts for future commu...