Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image inside UpdatePanel not working in Firefox

I have an image that is generated automatically inside an Ajax UpdatePanel. This image is a graph that is generated from server-side code. Searching in Google, I realised it was a bug of FF. Does anybody have any solution?

Here is the source (it contains also unneeded tags, I just copied-paste)

<div>
   <asp:UpdatePanel ID="UpdatePanelGraph" runat="server" UpdateMode="Conditional">
       <ContentTemplate>
           <asp:Panel ID="pnlGraph" runat="server" CssClass="container">
                <div id="chart">
                     <Web:ChartControl ID="chartExchange" runat="server" Width="300px" Height="200px" BorderStyle="None" GridLines="both" DefaultImageUrl="../images/noData.png" ShowTitlesOnBackground="False" BorderWidth="1px" Padding="1" HasChartLegend="False" BottomChartPadding="20" TopChartPadding="5" RightChartPadding="5" LeftChartPadding="20">
                            <Border Color="211, 224, 242"></Border>
                            <YAxisFont ForeColor="115, 138, 156" Font="Tahoma, 7pt" StringFormat="Far,Center,Character,LineLimit"></YAxisFont>
                            <XTitle ForeColor="115, 138, 156" StringFormat="Center,Near,Character,LineLimit">
                            </XTitle>
                            <XAxisFont ForeColor="115, 138, 156" StringFormat="Near,Near,Character,NoClip"></XAxisFont>
                            <Background Type="LinearGradient" Color="#C9DEFD" ForeColor="Transparent" EndPoint="500, 500">
                            </Background>
                            <ChartTitle ForeColor="51, 51, 51" Font="Verdana, 9pt, style=Bold" StringFormat="Near,Near,Character,LineLimit">
                            </ChartTitle>
                            <Charts>
                                <Web:SmoothLineChart Name="buy" Legend="Blen">
                                    <Line Color="ActiveCaption"></Line>
                                    <DataLabels>
                                        <Border Color="Transparent"></Border>
                                        <Background Color="Transparent"></Background>
                                    </DataLabels>
                                </Web:SmoothLineChart>
                                <Web:ColumnChart Name="avgChart">
                                </Web:ColumnChart>
                            </Charts>
                            <YTitle ForeColor="115, 138, 156" StringFormat="Center,Near,Word,LineLimit"></YTitle>
                    </Web:ChartControl>
                </div>                
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
like image 743
Iralda Mitro Avatar asked Apr 22 '26 18:04

Iralda Mitro


2 Answers

What version of .NET are you using? The 3.5 framework has a new graphing control. I spent a few days playing around with it, and was surprised at how powerful it is. And I also used it in UpdatePanels without any problems whatsoever.

like image 137
Jagd Avatar answered Apr 24 '26 08:04

Jagd


Also it is not a good solution, setting the cacheability to nocache resolved my problem. I worte this on my pageload

  Response.Cache.SetCacheability(HttpCacheability.NoCache);

It also works by setting this code

<script type="text/javascript">

      var prm = Sys.WebForms.PageRequestManager.getInstance();
      prm.add_pageLoaded(pageLoaded);
      var c = 0;
      function pageLoaded(sender, args)
      {
      var img = document.getElementById("ctl00_ctl00_MainContent_MainContent_chartExchange");
      c++;
      img.src = img.src + "?" + c;
      }

</script>
like image 22
Iralda Mitro Avatar answered Apr 24 '26 06:04

Iralda Mitro