Rev | Line | |
---|
[7849] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.IO;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Web;
|
---|
| 6 | using System.Web.UI;
|
---|
| 7 |
|
---|
| 8 | namespace 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.