zoukankan      html  css  js  c++  java
  • Problem in ASP.NET Chart control

    1. About Error:

    The type 'System.Web.UI.DataVisualization.Charting.Chart' exists in both 'c:\Windows\assembly\GAC_MSIL\System.Web.DataVisualization\3.5.0.0__31bf3856ad364e35\System.Web.DataVisualization.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.DataVisualization\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DataVisualization.dll


    To resolve the problem, change all the 3.5.0.0 to 4.0.0.0 in webconfig.

    2. Can't show image, maybe you drag the Chart control into page in 'source' model of .aspx, change it to  'design' model, the webconfig will add node like below automatic.

    <system.webServer>
      <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>
     
     <appSettings>
      <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
     </appSettings>

    Of course, you can also add it manual.

     3. No permission for access TempImage folder.

    If you use MS Chart Control on share hosting, normally, you don't have any permission outside your folder. At this time you need to remove all the folder setting regarding Chart Control, include 2 place:

       a. webconfig:  " />

         <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;

       b. the page which is using Chart Control: 

         <asp:Chart ID="Chart1" runat="server" Palette="BrightPastel" BackColor="#F3DFC1"

                ImageType="Png" ImageLocation="C:/TempImageFiles/ChartPic_#SEQ(300,3)" Width="800px"
                Height="500px" BorderDashStyle="Solid" BackGradientStyle="TopBottom" BorderWidth="2"
                BorderColor="181, 64, 1">

  • 相关阅读:
    《敏捷软件需求》阅读笔记三
    《敏捷软件需求》阅读笔记二
    《敏捷软件需求》阅读笔记一
    《需求工程-软件建模与分析》阅读笔记三
    《需求工程-软件建模与分析》阅读笔记二
    《需求工程-软件建模与分析》阅读笔记一
    C#.NET程序设计实验三实验报告
    C#.NET程序设计实验二实验报告
    C#.NET程序设计实验一实验报告
    oracle——存储数据时的编码问题
  • 原文地址:https://www.cnblogs.com/jiajinyi/p/2055421.html
Copyright © 2011-2022 走看看