Baidu rich text editor, data upload echo problem, images, attachments upload solution

1. First, go to the official website to download editor: http://ueditor.baidu.com/website/download.html    I use asp.net mvc development model so the election is asp

 

2. The two documents must refer to the front page, on his project to create a file folder and then what references

 

3. Set the size of the editor

 

4. How values ​​and call the editor, there are four ways the value is more practical. Look like you which one to use, one is pure content, have with html format, some take you edit what format

 

The pages are references and debugging after a good look at renderings are, of course, I use the page frame Layui

 

6. The front-end layout is over to upload data, and upload the data when I use: ajax submit background MVC controller; use here

  ueditor Editor submit <html> tag with data will be submitted when the pit, if the data is not encrypted, then will not submit the background, will report a fault, said data will take what script injection attacks can not be submitted to the background in this version after MVC4 some characteristics of a data transfer, the content can be encrypted with the front end submitted submitted to the background

 

7. I casually enter some content online, of course this is my copy of Kazakhstan .... just not right

(figure 1)

 

 

 

 (figure 2)

After Figure II is click submit, a map of the contents were encrypted, you can submit to a background

 

8. Here is a relatively simple back-end code, with the encrypted data can be submitted to the back-end, of course, the comments section is necessary to pass over to decrypt the data, so you can see what data is passed over things

 

 

Here below format data is decrypted with html tags and css what are, in the editor to edit the contents of the time will be with all content

 

 

 

 

9. On renderings, here is the title released

 

 

 

 

 

10. Click into the final results

 

 

 

 11. Of course, the view into the pages where the data removed from the database when there is a problem how to make data content into a page taken out of it?

  What made the time pass general database is what the string is the string "xxxxxxxxxxx", page spread is such a bunch of string, demonstrated here do not

solution:

  ASP.NET MVC in @ Html.Raw () use

   Can be self Baidu, will be able to use the content with native <html> tag is displayed on all pages

 

 

12. The rear end of the controller code to get data from a database, on ViewBag.load_Wu I submitted to the front end, of course, returned to the front end there are many methods, except that one I Ha

 

 

 

13. The front-end receiver, that is part of the arrow content display area, this can be coupled with the label contents of all displayed, that is, the effect of point 10 in FIG.

 

 

 

 

Images, attachments, upload Screen

1. Locate the file bag .json

 

 

 

2. Open the access path to find the picture where the arrows, into their own project file, the latter is the editor that comes upload folder, upload pictures or files are inside the path prefix way to change on the line, the renderings below, Annex under the same

 

 

3. upload pictures renderings

 

Page final results

 

  to sum up:

    These are my personal summary! It is also a little bit of groping write out, hoping to get help with editing partner!

These are original, reprint statement to the source!

 

Guess you like

Origin www.cnblogs.com/liuchunlin/p/11590430.html