ComponentOne Chart for .NET (2.0) Search HelpCentral 

Using the HTTPHandler with a File-based Transfer Method and a per-Application Image ID

To use HTTPHandler with a File-based transfer method and a per application 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 File.

·      Set the ImageIDGeneration property to Application.

·      Set the ImageUri property a viable folder on the server.

5.   To use the C1WebChart’s sample folder, for example, use:

  /C1WebChartApps/Sample/c1webchartimage.aspx

Run the program and notice the following:

The image tag created should look similar to:

<img id=_c1wc

rc='c1webchartimage.aspx?FileID=C1WebChartTemp/WebForm1.aspx_C1WebChart1.png'/>

Because the ImageIdGeneration property is set to Application, the FileID is common for each rendering of the chart and contains a virtual path to the temporary file used for the transfer. The virtual path consists of the virtual directory specified by the ImageUri property, and the file manufactured from the image type and the ID string. The file part of the ImageUri property is used to specify the HttpHandler page (it must match the httpHandler entry in the Web.Config file).

Image files created in this manner are set to expire based upon Absolute and Sliding expiration. The files are actually deleted during the next render, or by rendering of other C1WebChart files in the same directory.


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