WEB开发网
开发学院WEB开发ASP.NET 解决 ASP.NET Chart 控件出错 为 ChartImg.axd 执... 阅读

解决 ASP.NET Chart 控件出错 为 ChartImg.axd 执行子请求时出错

 2009-11-17 16:52:50 来源:WEB开发网   
核心提示:解决方法一:1. 修改web.Configview plaincopy to clipboardPRint?<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/TempImages/;" /&g
解决方法一:

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中添加上面的代码

Tags:解决 ASP NET

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接