ComponentOne Chart for .NET (2.0) Search HelpCentral 

Using HTTPHandler with a Cache-based Transfer Method and a Unique Image ID

To use HTTPHandler with a Cache-based transfer method and a unique image ID to transfer C1WebChart to the client, complete the following steps:

1.   Place a C1WebChart control on a form. A Confirmation dialog box appears.

2.   Click Yes to add the HttpHandler to the web.config file. This configures the application to enable the C1WebChart's built-in HttpHandler.

The following entry is added to the Web.config file:

<configuration>

  <system.web>

    <httpHandlers>

      <add verb="*" path="c1chartimage.aspx"

         type="C1.Web.C1WebChart.ImageHttpHandler,C1.Web.C1WebChart.2"/>

    </httpHandlers>

  </system.web>

<configuration>

3.   Configure the data and appearance elements as desired.

4.   Set C1WebChart's properties to the following:

·      Set the ImageRenderMethod property to HttpHandler.

·      Set the ImageTransferMethod property to Cache.

·      Set the ImageIDGeneration property to Unique.

·      Set the ImageUri property to an empty string.

Run the program and notice the following:

The image tag created should look similar to:

<img id=_c1wc src='c1webchartimage.aspx?CacheID=91…93&Delete=T'/>

Because the ImageIDGeneration property is set to Unique, the CacheID attribute is unique for each rendering of the chart. It provides access to the following Cache entries:

91…93_ImageBytes (image)

91…93_Hash (hash code and image type)

The Delete=T attribute causes the cache entries to be deleted after the data is received by the HTTPHandler. This attribute is always invoked for Unique IDs.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.