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