07.lot.ui front and rear universal frame decomposition Series--Lightweight text editor

Source: Internet
Author: User

Lot.ui Summary: Http://www.cnblogs.com/dunitian/p/4822808.html#lotui

Last said is a powerful Baidu editor http://www.cnblogs.com/dunitian/p/5551701.html This time the concise version but also without losing the function of the wangeditor

First look at the effect

Basically common functions have, the following is the complete demo:

Front-end Case:

<! DOCTYPE html>

Back-end code: (Write yourself, if you have any questions welcome to contact me)

<summary>//image upload///</summary>//<returns></returns> public C            Ontentresult Upload (httppostedfilebase file) {if (file = = null) {return Content ("error| cannot be Empty");}            String filterstr = ". Gif,.jpg,.jpeg,.bmp,.png"; If you are uploading a file, add another format to string fileext = path.getextension (file. FileName).            ToLower ();            if (!filterstr.contains (Fileext)) {return Content ("error| file suffix is incorrect");} if (file.            ContentLength > 10485760) {return Content ("error| files within 10M");}            TODO:MD5 determine if the file has been uploaded, if it has been uploaded directly back to return Content (sqlpath# thumbnail address); String path = string.            Format ("{0}/{1}", "/lotfiles", DateTime.Now.ToString ("Yyyy-mm-dd")); String fileName = String. Format ("{0}{1}", Guid.NewGuid ().            ToString ("N"), Fileext); String SQLPath = String.            Format ("{0}/{1}", Path, fileName);            String dirpath = Request.mappath (path); if (! Directory.Exists (DIRPATH) {directory.createdirectory (Dirpath);} try {//todo: The code file for the future write thumbnail.                SaveAs (Path.Combine (Dirpath, fileName));            TODO: Future write database code} catch {return Content ("error| File Save Failed");} Return Content (String.        Format ("{0}#{1}", SQLPath, "thumbnail address"); }

Full DEMO:HTTPS://GITHUB.COM/DUNITIAN/LOTCODEBASE/TREE/MASTER/NETCODE/3. Common Skills/03.editor/03.wangeditor

07.lot.ui front and rear universal frame decomposition Series--Lightweight text editor

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.