Use Baidu Rich Text Editor and MVC Baidu text editor in mvc

Source: Internet
Author: User

Use Baidu Rich Text Editor and MVC Baidu text editor in mvc
1. Download the. NET version Baidu Rich Text Editor and download the. NET version Baidu rich text box.

2.decompress The. Zip compressed package, the utf8-.net folder name to: ueditor, copy to the MVC root directory. The structure is as follows:

The file on App_Code is the application source code.

  • Config. cs reads the configuration file
  • Handler. cs is the base class of the request processor. It provides access and Output Control for some basic objects. If you need to add a processor, you should inherit from this base class.
  • PathFormatter. cs parses PathFormat and fills the information into runtime information.
  • * Handler. cs is a variety of processors that process requests required by various ueditors.

Bin contains the application dependency library, which is currently dependent on the Newtonsoft Json library. The Bin directory and App_Code directory are protected by applications and do not worry about being accessed by users.

Config. json is the UEditor backend configuration file. The previous section describes important configuration items.

Controller. ashx is the UEditor request entry, which distributes different actions to different Handler for processing.

Net. sln is the solution file of the Project. machines installed with Visual Studio 2013 or later can be opened for project transformation.

README. md is this document.

Web. config is the configuration file of the application.

3. For other configurations, refer to the official documentation of Baidu rich text box.
4.copy the code in index.html to the index in the Home controller and try to modify the src of the script link: Add a prefix for it ~ /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 normal and all functions can be implemented. 

Related Article

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.