WebGrid Community Server

Welcome to WebGrid Community Server Sign in | Join | Help
in Search

Chart column not updating on postback

Last post 07-25-2008, 15:20 by PRFerro. 4 replies.
Sort Posts: Previous Next
  •  03-23-2007, 0:57 221

    Chart column not updating on postback

    Olav -

    I have a chart on a page whos datasource is a datatable.  A user can update paramaters which will cause a postback, and a new datatable is created with different data, and the chart's datasource is set again to the datatable.  The problem is that the chart does not update on a postback, no matter what data is in the datatable.... The values on the chart will remain the same as when the chart was first created on page load.  I've tried following the starterkit example and manually changing the data of the chart/etc., but I can't seem to get any of it to work.  I've also tried recreating a new grid and chart column and rendering it to a label control with no luck.  Any way I can get the chart to update itself on a postback?

    Aaron
  •  03-23-2007, 7:53 222 in reply to 221

    Re: Chart column not updating on postback

    Can you sent me your code and your datatable data on e-mail so I can investigate this issue ?!

    Olav

    Olav Botterli, WebGrid Founding Developer
  •  06-20-2008, 22:34 590 in reply to 222

    Re: Chart column not updating on postback

    Hello Olav,
    I want to tell you THANK YOU for your hard work in this control. It's just great!

    I have the same issue like Aaron, but only with IE6, When I use Internet Explorer 7 everything works great.

    May be an option on internet explorer 6 or something like that?
    Some of our users are working with IE6.


    Greetings,
    Omar Rodríguez.
  •  06-23-2008, 21:53 593 in reply to 590

    Re: Chart column not updating on postback (Solution)

    Hello everybody,

    I found the solution:

    Go to the Internet Explorer Options, then Browsing History/Settings, and select the option "Check for newer version of stored pages" --> Every time I Visit the page.
    Same for IE6 or IE7.


    Olav, I think that this is a know issue with Ajax and IE, in order to avoid that, when we are using images with ajax, we must add a query string with a random value at the end of the Image address.

    Example:
    If the image address is: http://myserver/images/mypicture.jpg,
    you can change this address by:
    http://myserver/images/mypicture.jpg?Q=AnyMath.RandomValue()


    Another options that I found, but without results for me were add these lines of code on my page.


    response.setDateHeader( “Expires”, -1 );
    response.setHeader( “Cache-Control”, “private” );
    response.setHeader( “Last-Modified”, new Date().toString() );
    response.setHeader( “Pragma”, “no-cache” );
    response.setHeader( “Cache-Control”, “no-store, no-cache, must-revalidate” );

    more info:
    http://en.wikipedia.org/wiki/AJAX

    http://webreflection.blogspot.com/2006/12/stupid-ajax-cache-problem-solution.html?q=%20Math.random()


    If some body can fix this situation without change any options in the internet explorer please let me know.


    Greetings,
    Omar Rodríguez





  •  07-25-2008, 15:20 683 in reply to 593

    Re: Chart column not updating on postback (Solution)

    I was having the same problem with the webgrid chart and after some searching I find this solution:

    Add this cache directive on your page:

    <%@ OutputCache Location="None" %>

    That worked for me.

    I also find a lot more of code, maybe usefull for someone:

        Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            Response.ClearHeaders()
            Response.AppendHeader("Cache-Control", "no-cache")
            Response.AppendHeader("Cache-Control", "private")
            Response.AppendHeader("Cache-Control", "no-store")
            Response.AppendHeader("Cache-Control", "must-revalidate")
            Response.AppendHeader("Cache-Control", "max-stale=0")
            Response.AppendHeader("Cache-Control", "post-check=0")
            Response.AppendHeader("Cache-Control", "pre-check=0")
            Response.AppendHeader("Pragma", "no-cache")
            Response.AppendHeader("Keep-Alive", "timeout=3, max=993")
            Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT")
            Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))
            Response.Cache.SetCacheability(HttpCacheability.NoCache)
            Response.Cache.SetNoStore()
            Response.Cache.SetNoServerCaching()
        End Sub

    Hope that helps you.

    Bye.

    (sorry for my english)

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems