Apply Baidu Rich Text editor in MVC

Source: Internet
Author: User

1. Download. NET version of Baidu Rich Text editor, go to download. NET version Baidu Rich text box

2. Unzip the downloaded. zip package, change the Utf8-.net folder name to: Ueditor, and copy it to the MVC root directory. The structure is as follows:

The file on App_Code is the source code for the application

    • Config.cs is responsible for reading the configuration file
    • Handler.cs is the base class for the request processor, providing access to some basic objects and output control. If you need to increase the processor, you should inherit from the base class
    • PathFormatter.cs Parse Pathformat to populate the information as run-time information.
    • *handler.cs is a variety of processors that handle requests for various ueditor needs.

Inside the Bin is the application's dependent library, which currently relies on the Newtonsoft Json library. The Bin directory and the App_Code directory are protected by the application without fear of being accessed by the user.

Config.json is the configuration file for the Ueditor backend, and the previous section has described the more important configuration items.

Controller.ashx is the entrance to the Ueditor request, which distributes different actions to different Handler.

Net.sln is a project solution file that installs Visual Studio 2013 or more machines that can be turned on for project Retrofits.

README.MD is a document of this description.

Web. config is the application's configuration file

3. Other configuration can refer to Baidu Rich text box official documents
4. Copy the code in index.html to index in the home controller, and modify the src: prefix for the script link ~/ueditor/
    <script type= "Text/javascript" charset= "Utf-8" src= "~/ueditor/ueditor.config.js" ></script>    < Script type= "Text/javascript" charset= "Utf-8" src= "~/ueditor/ueditor.all.min.js" > </script>    < Script type= "Text/javascript" charset= "Utf-8" src= "~/ueditor/lang/zh-cn/zh-cn.js" ></script>

compile and run the program, the effect is as follows, the backend configuration is OK, can realize all functions

Apply Baidu Rich Text editor in MVC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.