Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.NET图表生成不带文件名的图像文件_Asp.net_Charts - Fatal编程技术网

Asp.NET图表生成不带文件名的图像文件

Asp.NET图表生成不带文件名的图像文件,asp.net,charts,Asp.net,Charts,我正在使用ASP.NET图表控件。在我的页面上有很多(大约10个,都在一个Repeter中)图表 每个图表都将ImageStorageMode设置为“UseMageLocation” 问题是,由于某种原因,每个图表控件生成一个没有文件名的图像文件,扩展名只有.PNG。因此,它们相互覆盖,并且在页面上每隔一天只显示最后一个图像 建议?您是否尝试设置ImageUrl属性 下面是关于如何使用它的更多信息 如果这不起作用,也发布一些示例代码 我刚刚遇到了这个问题,并找出了问题所在。我得到的暗示来自 正如

我正在使用ASP.NET图表控件。在我的页面上有很多(大约10个,都在一个Repeter中)图表

每个图表都将ImageStorageMode设置为“UseMageLocation”

问题是,由于某种原因,每个图表控件生成一个没有文件名的图像文件,扩展名只有.PNG。因此,它们相互覆盖,并且在页面上每隔一天只显示最后一个图像


建议?

您是否尝试设置ImageUrl属性

下面是关于如何使用它的更多信息 如果这不起作用,也发布一些示例代码


我刚刚遇到了这个问题,并找出了问题所在。我得到的暗示来自

正如MSDN所说,
Chart.ImageLocation
的属性似乎有点误导

表示当前图表图像URL的字符串值

然而,这也应该包括一个文件名,我怀疑你有这样的东西

Chart chart = new Chart();
chart.RenderType = RenderType.ImageTag;
chart.ImageStorageMode = ImageStorageMode.UseImageLocation;
chart.ImageLocation = "~/TempImages/";
<img src="/TempImages/.png?y56r6y7f5w4r5" />
chart.ImageLocation = "~/TempImages/ChartPicture_#SEQ(300,5)";
ChartPicture_000001.png
ChartPicture_000002.png
ChartPicture_000003.png
ChartPicture_000004.png
...
这将生成一个像这样的图像URL

Chart chart = new Chart();
chart.RenderType = RenderType.ImageTag;
chart.ImageStorageMode = ImageStorageMode.UseImageLocation;
chart.ImageLocation = "~/TempImages/";
<img src="/TempImages/.png?y56r6y7f5w4r5" />
chart.ImageLocation = "~/TempImages/ChartPicture_#SEQ(300,5)";
ChartPicture_000001.png
ChartPicture_000002.png
ChartPicture_000003.png
ChartPicture_000004.png
...
现在您将生成这样的图像

Chart chart = new Chart();
chart.RenderType = RenderType.ImageTag;
chart.ImageStorageMode = ImageStorageMode.UseImageLocation;
chart.ImageLocation = "~/TempImages/";
<img src="/TempImages/.png?y56r6y7f5w4r5" />
chart.ImageLocation = "~/TempImages/ChartPicture_#SEQ(300,5)";
ChartPicture_000001.png
ChartPicture_000002.png
ChartPicture_000003.png
ChartPicture_000004.png
...