ASP.NET 4.0图表控件断开的图像链接

我在Web窗体项目中设置了microsoft图表控件。图表呈现为断开的图像链接。我尝试添加图表控件的页面位于具有以下路径的位置:

http://localhost/application/default.aspx

正在生成的损坏的图像链接为:

http://localhost/Application/ChartImg.axd?i=chart_14e94045c8ec4bd1b79f8ad4a6e25239_0.png&g=10889d08b1644464955d275d1f800315

如果我手动将损坏的图像链接更改为以下内容,它将呈现:

http://localhost/ChartImg.axd?i=chart_14e94045c8ec4bd1b79f8ad4a6e25239_0.png&g=10889d08b1644464955d275d1f800315

Web.config:

<add name="ChartImg" verb="*" path="ChartImg.axd" type="system.web.UI.DataVisualization.Charting.ChartHttpHandler,system.web.DataVisualization,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35" />;

<add key="ChartImg" value="Storage=memory;Timeout=20;"/>

(Also tried <add key="ChartImg" value="storage=file;timeout=20;dir=c:\TempImageFiles\;"/ >)

更新

是导致问题的ChartImg.axd处理程序的实际位置。我认为页面继承和名称空间在这个庞大的旧项目中被弄乱了。我试图将图表添加到/ Application目录中的页面-我需要能够更改处理程序的路径。有人吗?

qqleecs 回答:ASP.NET 4.0图表控件断开的图像链接

我能够通过在项目根目录中使用相同的母版页创建一个新页面,然后在有问题的页面中使用iframe引入图表来解决此问题。我找不到其他方法以编程方式更改ChartImg.axd处理程序本身的“虚拟”位置。

<iframe src="../Metrics.aspx" height="400" width="400" frameborder="0"></iframe>
本文链接:https://www.f2er.com/3078958.html

大家都在问