Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.Net Charts - Obtaining via jQuery on IE 7 causes the image not to load
    text
    copied!<p>I am using the <a href="http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx" rel="nofollow noreferrer">ASP.Net Charting Controls</a> and ASP.Net MVC. </p> <p>I am trying to have a chart displayed on a page, the user can change various data associated with this chart and then press a button which will perform a POST operation and then return a newly rendered chart. This is refreshed via jQuery which loads a partial view containing the chart. </p> <p>The problem I am having is that in IE 7 I get the image could not be found icon. Bizarrely it works fine in Firefox! </p> <p>The process of updating chart:</p> <ul> <li>Send new parameters in a POST</li> <li>Application changed parameters on the chart object</li> <li>Controller sends Chart Object to Partial View which renders it like a control</li> <li>jQuery then loads in this partial view. In IE 7 i get the image not found icon. </li> </ul> <p>Here is the code used in the Partial View to render the Chart Object:</p> <pre><code>if (Model.Chart != null) { Model.Chart.Page = this.Page; System.Web.UI.DataVisualization.Charting.Chart Chart1 = Model.Chart; using (HtmlTextWriter writer = new HtmlTextWriter(this.Response.Output)) { try { Chart1.ImageType = System.Web.UI.DataVisualization.Charting.ChartImageType.Jpeg; Chart1.RenderControl(writer); } catch (Exception ex) { writer.WriteEncodedText(ex.Message); } } } </code></pre> <p>Cheers!</p> <p>The jQuery which loads these charts is as follows:</p> <pre><code>function PostWidgetDataOverride(ChartID) { $.ajax({ url: "/Home/GetChart", type: "POST", dataType: "HTML", data: { ChartID: ChartID, SeriesID: $('.SeriesID').val(), ParameterDefaults: $('.parameterDefault').serialize(), Time: getTimeStamp() }, success: UpdateChart }); } function UpdateChart(ChartContent) { $("#widgetConfig").dialog("close"); var existingChart = CheckIfWidgetIsOnPage($(ChartContent).attr("id")) if (existingChart !== undefined) { existingChart.fadeOut("slow", function() { existingChart.replaceWith(ChartContent); }).fadeIn("slow"); } else { $(ChartContent).appendTo($("#dashboardArea")).fadeIn("slow"); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload