解决方法一:
1. 修改web.Config
view plaincopy to clipboardprint?
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/TempImages/;" />
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/TempImages/;" />
将其中的 dir=c:\TempImages\ 的绝对路径 修改外 url=~/TempImages/ 相对路径 (前提条件:网站文件中必须包含 TempImages文件夹)
2. 修改
view plaincopy to clipboardprint?
<add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
<add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
为
view plaincopy to clipboardprint?
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
3. 修改
view plaincopy to clipboardprint?
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
为:
view plaincopy to clipboardprint?
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
解决方法二:
打开*.aspx页面,删除原来MSCchart产生的网页代码(如果你的MSChart控件已经都设置好了很多项觉得删除可惜,就剪切吧)
然后切换到设计界面,在工具箱中选择MSChart控件,重新拖入进去,就可以自动在web.config中添加上面的代码