开发者

Microsoft Charting Controls for IE6 using asp.net mvc not working

i have a big problem here..i am using Microsoft charting controls in my asp.net mvc application..pie chart is working in my Mozilla Firefox perfectly when i 开发者_开发技巧open try to run the application in IE the chart is not displaying. when i refresh the page couple of times its showing the chart there?

is there anything doing wrong?

please can anybody help me out

thanks


I use also Microsoft Chart control in my ASP.NET MVC application. The problem which you describe can not appears in my case. I can explain why. I have a MVC Controller with the method GetChart which gives back pure PNG file as a stream. So I define on a HTML page (on a View to be exactly) a <img> element with src attribute like "<%= Url.Content ("~/Home/GetChart")%>". So web browser load and display a PNG graphic only. Such implementation works perfect in all browsers. It is also tested and works with IE6.

My GetChart method looks like following:

public FileStreamResult GetChart (/*some additional parameters*/) {
    MyChartModel model = new MyChartModel ();

    System.Web.UI.DataVisualization.Charting.Chart chart =
        model.CreateChart (/*some parameters*/);

    // Save the chart in a MemoryStream
    MemoryStream imageStream = new MemoryStream ();
    chart.SaveImage (imageStream, ChartImageFormat.Png);

    // Reset the stream’s pointer back to the start of the stream. 
    imageStream.Seek (0, SeekOrigin.Begin);

    return new FileStreamResult (imageStream, "image/png");
}

The code of the model MyChartModel is a little longer, but if you have already a implementation of Microsoft Chart you have already all needed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜