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 use VNC

Setting up direct connections If you have an Enterprise subscription, you can establish direct connections to computers you want to control. This is in addition to, or instead of, cloud connections . If you have a Home or Professional subscription, only cloud connectivity is available. No connection set up is required; you do not need to follow the instructions on this page. See how to get connected . To establish a direct connection, you’ll likely need to configure the network environment of the remote computer, particularly when routing over the Internet. Follow the appropriate infographic below. Establishing a direct connection over a local network (LAN or VPN) You will need: A computer to control: A device to control from: Both devices connected to the same local network: Now do this: Download VNC Connect to the computer you want to control and choose an Enterprise subscription. Use VNC Server to look up the private (internal) IP addre...