source: code/Website/dot-net-library/written-by-xiao-yifang/OpenFlashChart/WebHandler/ofcHandler.cs@ 7937

Last change on this file since 7937 was 7849, checked in by dennisw, 15 years ago
File size: 1.6 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Text;
5using System.Web;
6using System.Web.UI;
7
8namespace OpenFlashChart.WebHandler
9{
10 public class ofcHandler: IHttpHandler
11 {
12 /// <summary>
13 /// Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler" /> interface.
14 /// </summary>
15 /// <param name="context">An <see cref="T:System.Web.HttpContext" /> object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests. </param>
16 public void ProcessRequest(HttpContext context)
17 {
18 using (TextWriter writer = new HtmlTextWriter(context.Response.Output))
19 {
20 string chartID = context.Request.QueryString["chartjson"];
21 if (chartID == null)
22 return;
23 string chartjson = (string)context.Cache[chartID];
24 context.Response.Clear();
25 context.Response.CacheControl = "no-cache";
26
27 writer.Write(chartjson);
28 }
29 }
30
31 /// <summary>
32 /// Gets a value indicating whether another request can use the <see cref="T:System.Web.IHttpHandler" /> instance.
33 /// </summary>
34 /// <returns>
35 /// true if the <see cref="T:System.Web.IHttpHandler" /> instance is reusable; otherwise, false.
36 /// </returns>
37 public bool IsReusable
38 {
39 get { return true;}
40 }
41 }
42}
Note: See TracBrowser for help on using the repository browser.