asp.net chart control not working on shared hosting

Posted on 2014-03-04
Medium Priority
Last Modified: 2014-03-09
Hi all - I'm new to asp.net but currently working on figuring out whatb chart control is all about...  I've got it working on my local vs2010 site, but the chart just doesn't work on my shared hosting site.

My shared hosting provider is fasthosts.co.uk, which have yet to respond to my support request to them.

Shared hosting is .net v4.5

Can anyone tell me what I'm doing wrong?

Here's my web.config:
        <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />

            <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             validate="false" />
                <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting"
                 assembly="System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

        <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
                <add assembly="System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        <modules runAllManagedModulesForAllRequests="true" />
            <remove name="ChartImageHandler" />
            <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
             path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


Open in new window

Here's my chart.aspx:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="chart.aspx.vb" Inherits="chart" %>

<%@ Register assembly="System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">

               <asp:Chart ID="Chart1" runat="server">
                <asp:Series Name="Series1">
                        <asp:DataPoint AxisLabel="Product A" YValues="123" />
                        <asp:DataPoint AxisLabel="Product B" YValues="456" />
                        <asp:DataPoint AxisLabel="Product C" YValues="789" />
                        <asp:DataPoint AxisLabel="Product D" YValues="321" />
                <asp:ChartArea Name="ChartArea1">
                        IsClustered="false" />
                    <AxisY IsLogarithmic="true" />

Open in new window

All i get back from the browser is:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

if I remove the chart related bits from the web.config then the chart.aspx doesn't error, but no chart!

Any ideas?

Question by:ErinOP
  • 8
  • 3
LVL 83

Expert Comment

ID: 39904146
Try setting debug to true and disabling custom error pages so that you can see what the issue is.

Author Comment

ID: 39904164
Hi - debug is already=true.

I had already had custom error pages=off before i added any chart control logic, but that gave me a server 500 error too!

Any ideas?
LVL 83

Expert Comment

ID: 39904198
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

ID: 39904240
Hi - ok, thanks for that - however, I've done what that article says to do, but it still fails.

I've added the customerror mode=off, but still get the high level and useless server error 500.

Any ideas?

Author Comment

ID: 39904449
Does anyone have working chart control code, that i can test?

So I can isolate to either the web.config/aspx code, or the hosting platform?!

Accepted Solution

ErinOP earned 0 total points
ID: 39904474

I've just been contacted by Fasthost.co.uk technical support and they respond with:

We have checked your file uploaded and we are afraid this is not supported on the server as requires some configuration on the server side which is not supported.

Does this make sense, cause since .net v4 isn't chart control all integrated into the .net framework and doesn't need further downloads or config?  

what do the experts say?
LVL 83

Expert Comment

ID: 39904552
There are still parts of config which are not same on all hosting providers. Example is medium trust vs full trust.

Author Comment

ID: 39904557
Does this relate to the chart, not sure what your point is?

Author Comment

ID: 39905851
answered the question myself.

Author Comment

ID: 39905853
answered the question myself.

Expert Comment

by:Johny Bravo
ID: 39906439
Hi ErinOP,

I know his question is closed but still for future references answering this.

Check if this works for you. As in shared hosting we have limited access., dir=c:\TempImageFiles\; cause this error.

Try with
     <add key="ChartImageHandler" value="storage=memory;deleteAfterServicing=true;"/>

Author Closing Comment

ID: 39915676
answered the question myself.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
There is a wide range of advantages associated with the use of ASP.NET. This is why this programming framework is used to create excellent enterprise-class websites, technologies, and web applications.
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question