ComponentOne Chart for .NET (2.0) Search HelpCentral 

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

To use HTTPHandler with a File-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 File.

·      Set the ImageIDGeneration property to Unique.

·      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

  src='c1webchartimage.aspx?FileID=/C1WebChartApps/Sample/91…93.png&Delete=T'/>

Because the ImageIDGeneration property is set to Unique, the FileID is unique for each rendering of the chart. It contains the virtual path to the temporary file used for the transfer. The virtual path consists of the virtual directory specified by the ImageUri property and a file name manufactured from the image type and the unique ID string. The file part of the ImageUri property is used to specify the HTTPHandler page.

If the ImageUri property is blank, default values are used.

The Delete=T attribute causes the temporary file 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.