<%@ WebHandler Language="C#" Class="PaintView" %> using System; using System.Collections.Generic; using System.Web; using Tools; public class PaintView : IHttpHandler { HttpRequest Request = null; HttpResponse Response = null; public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; Request = context.Request; Response = context.Response; string method = Request.Params["method"]; switch (method) { case "getBar": getBar(); break; } } public bool IsReusable { get { return false; } } void getBar() { StockModel md = Function.getBar(); Response.Write(JSONTools.ScriptSerialize(md)); Response.End(); } }