Geeks With Blogs
Devin Rader's Blog I write the code...

The UltraWebChart has two in-the-box options for deployment: FileSystem or Session.  The FileSystem option basically writes the rendered chart image to the web servers disk drive, and renders a standard image tag to the web page which points to that image as its src:

<IMG id=UltraChart1_BaseImage src="/devin/ChartImages/Chart_72.png?KxRx=0x01051" .../>

While a simple and reliable deployment option, the FileSystem option does have some drawbacks.

1) It requires that you give the ASPNET user Write permissions to some folder on the web server.  You may not want to do this for security reasons.

2) It does not work well if you are hosting your web application in a server farm configuration.  Because the image is written to only the single web server where the ASP.NET page containing the chart control was originally processed, when the browser makes the request for the chart image, that request may not go back to that original server, which would result in a 404 error.

To solve these two problems, the chart control also includes a second deployment option, the Session State deployment option.  This option utilizes ASP.NET's Session State server to store the render chart images, and generates a specialized URL for the <IMG> tags src attribute which allows the browser to pull the image from the session server, rather than from the web servers disk:

<IMG id=UltraChart1_BaseImage src="/devin/admin/ImagePipe.aspx?ChartID=UltraChart1_Base&KxRx=0x05828" .../>

Notice in this <IMG> tag, the src property points to an ASP.NET page called ImagePipe.aspx.  This page serves as the endpoint which allows the browser to retrieve the rendered chart image from the session server.  It is able to do this because this page contains a special server control called the SecureImagePipe control, which ships in the UltraWebChart assembly.  This special control uses querystring values to determine which chart image should be pulled from the session server, then modifies the the ContentType of its host web page to be an image (Content-Type: image/png) before streaming the rendered chart back to the browser.  Modifying the ContentType type tells the browser that this request is returning an image, rather than normal text/html content.

The diagram below shows how the request processing works when using the Session State deployment option:

Configuring the UltraWebChart for Session State deployment

Now that you know a little about the UltraWebCharts Session deployment option, let me walk you through setting the chart up in this configuration:

  1. Start by ensuring that your ASP.NET State Server is installed and started.  This great MSDN article by Rob Howard discusses the ASP.NET Session State options in detail.  Remember that if your application is running in a server farm configuration, you need to make sure you are using either the Out-of-process mode or the SQL Server mode so t hat a single State Server can be shared by all of the web servers in your farm.
  2. To configure your chart control to use the session server, change the controls DeploymentScenerio.Scenerio property value to Session
  3. Next add a new page to your ASP.NET application which will be used to host the SecureImagePipe component.  By default the chart control expects this page to be named ImagePipe.aspx, but you can configure this by changing the chart controls ImagePipePageName property.
  4. Once the new page has been added to your project simply add a SecureImagePipe control to the page. Remember that because the SecureImagePipe control will automatically alter the pages ContentType, any other control you add to the page will not be capabile of rendering.

Thats it.  Your chart should now be using the ASP.NET Session server to store the rendered chart images.  You can see both the FileSystem and Session deployment options in action by checking our our online ASP.NET samples at


Posted on Wednesday, August 9, 2006 7:12 AM | Back to top

Comments on this post: UltraWebChart Session deployment

# re: UltraWebChart Session deployment
Requesting Gravatar...
Thanks for this article!!!
Left by Uwe on Jan 11, 2007 1:20 AM

# re: UltraWebChart Session deployment
Requesting Gravatar...
Thanks for this article. Its very helpfull
Left by VS on Sep 07, 2008 4:25 PM

# re: UltraWebChart Session deployment
Requesting Gravatar...
the control not run, impossible to find infomation of Session deployment and the oficial page dont talk about this problem.

i try to configurate the session deplyment any times, but its impossible.

very bad control to work.....
Left by Alvaro Garcia Morales on Sep 30, 2008 8:36 PM

# re: UltraWebChart Session deployment
Requesting Gravatar...
Excellent! Just what I needed!

Left by Erich Musick on Oct 07, 2009 12:43 PM

Your comment:
 (will show your gravatar)

Copyright © Devin Rader | Powered by: