Solved

asp.net chart control not working on shared hosting

Posted on 2014-03-04
12
1,129 Views
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:
<configuration>
    <appSettings>
        <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
    </appSettings>
    
    <system.web>

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


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

    </system.web>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <handlers>
            <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=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </handlers>
    </system.webServer>


</configuration>

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=4.0.0.0, 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">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>


               <asp:Chart ID="Chart1" runat="server">
            <series>
                <asp:Series Name="Series1">
                    <Points>
                        <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" />
                        
                    </Points>
                </asp:Series>
            </series>
            <chartareas>
                <asp:ChartArea Name="ChartArea1">
                    <Area3DStyle
                        rotation="10"
                        Perspective="10"
                        Enable3D="true"
                        Inclination="15"
                        IsRightAngleAxes="false"
                        WallWidth="0"
                        IsClustered="false" />
                    <AxisY IsLogarithmic="true" />
                </asp:ChartArea>
            </chartareas>
        </asp:Chart>
    
    </div>
    </form>
</body>
</html>

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?

EOP
0
Comment
Question by:ErinOP
  • 8
  • 3
12 Comments
 
LVL 83

Expert Comment

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

Author Comment

by:ErinOP
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?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39904198
0
 

Author Comment

by:ErinOP
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?
0
 

Author Comment

by:ErinOP
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?!
0
 

Accepted Solution

by:
ErinOP earned 0 total points
ID: 39904474
ok!  

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?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 83

Expert Comment

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

Author Comment

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

Author Comment

by:ErinOP
ID: 39905851
answered the question myself.
0
 

Author Comment

by:ErinOP
ID: 39905853
answered the question myself.
0
 
LVL 8

Expert Comment

by:johny_bravo1
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
 <appSettings>
     <add key="ChartImageHandler" value="storage=memory;deleteAfterServicing=true;"/>
   </appSettings>
0
 

Author Closing Comment

by:ErinOP
ID: 39915676
answered the question myself.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Name space syntax error 12 44
Ajax Panel Not Updating When Triggered By Timer 4 46
Vb. Net application freezes 9 31
Web Form VB.Net  import CSV 4 27
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now