Ask a questionAsk a question
 

AnswerEmpty chart created on Update Panel refresh

  • Wednesday, October 21, 2009 7:33 AMDrSkill Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello everybody,

    I have a problem  with a chart control within an ajax update panel.

    On my page there is an update panel which contains a chart control and a link button which is use for triggering the actual values. So at the link button click event i call the databind method to get the new values for the chart, that works all great.
    But sometimes (at first call of the page) the update panel gets refreshed a second time (without trigger) and a new image without values is generated.

    I figured out that at every update panel refresh a new chart image is rendered. I can see that if i take a look in the temporary char image folder.
     There exists the possibility to enable view state, but my chart contains a very high number of values an that will cost too much traffic. I also don't want to render a chart at every update panel load event., because i have a timer which calls another update panel cyclic an so the update panel load event for the chart control is also called cyclic at server.

    Is there a workaround that a new "image" is only created e.g. on a click event and not when the site gets refreshed?

    My Settingts:

    Imagelocation: ~/ChartImages/ChartPic_#SEQ(100,10000)
    ImageStoreMode: UseImageLocation

Answers

  • Wednesday, October 28, 2009 10:53 AMsuthish s nair Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    did you try EnableViewState = true for chat
    SSN "If you want to live a happy life, tie it to a goal. Not to people or things." : Albert Einstein

All Replies

  • Saturday, October 24, 2009 11:46 AMsuthish s nair Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    try rebinding the chart again.
    SSN "If you want to live a happy life, tie it to a goal. Not to people or things." : Albert Einstein
  • Wednesday, October 28, 2009 8:36 AMDrSkill Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    yes i know that will work, but my site implements a cyclic timer which refreshs every 5 seconds another control. so also my chart will be refreshed and the server must render every 5 seconds a new chart.
  • Wednesday, October 28, 2009 10:53 AMsuthish s nair Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    did you try EnableViewState = true for chat
    SSN "If you want to live a happy life, tie it to a goal. Not to people or things." : Albert Einstein
  • Wednesday, October 28, 2009 2:33 PMCole Brand Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    did you try EnableViewState = true for chat

    I think this is what the OP is asking. Using this will ensure that the chart doesn't get refreshed unless you do it in code.

    Please don't forget (and feel free to remind me) to post if you got the answer you wanted, and select who really answered your post when you do so future visitors will know too! Remember, this is .NET 4.0 in a .NET 3.5 world, you're a pioneer right now.
  • Thursday, October 29, 2009 2:21 PMDrSkill Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    yes i tried to set EnableViewState to true, but my chart may have about 10000 values an so that would cost to much traffic!
  • Friday, November 06, 2009 3:58 PMAlex GorevMSFT, OwnerUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You really only have two options... Persist the data in the view state or keep the state on the server by rebinding the chart every time.

    Alex.
    http://blogs.msdn.com/alexgor