getContent.ashx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <%@ WebHandler Language="C#" Class="getContent" %>
  2. /**
  3. * Created by visual studio 2010
  4. * User: xuheng
  5. * Date: 12-3-6
  6. * Time: 下午21:23
  7. * To get the value of editor and output the value .
  8. */
  9. using System;
  10. using System.Web;
  11. public class getContent : IHttpHandler {
  12. public void ProcessRequest (HttpContext context) {
  13. context.Response.ContentType = "text/html";
  14. //获取数据
  15. string content = context.Request.Form["myEditor"];
  16. //存入数据库或者其他操作
  17. //-------------
  18. //显示
  19. context.Response.Write("<script src='../third-party/jquery.min.js'></script>");
  20. context.Response.Write("<script src='../third-party/mathquill/mathquill.min.js'></script>");
  21. context.Response.Write("<link rel='stylesheet' href='../third-party/mathquill/mathquill.css'/>");
  22. context.Response.Write("<div class='content'>" + content + "</div>");
  23. }
  24. public bool IsReusable {
  25. get {
  26. return false;
  27. }
  28. }
  29. }