.NET Framework Developer Center >
.NET Development Forums
>
Chart Controls for .NET Framework
>
Empty chart created on Update Panel refresh
Empty chart created on Update Panel refresh
- 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
- 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- Marked As Answer byAlex GorevMSFT, OwnerThursday, November 19, 2009 4:19 PM
- Proposed As Answer byCole Brand Wednesday, October 28, 2009 2:32 PM
All Replies
- 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 - 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.
- 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- Marked As Answer byAlex GorevMSFT, OwnerThursday, November 19, 2009 4:19 PM
- Proposed As Answer byCole Brand Wednesday, October 28, 2009 2:32 PM
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.- yes i tried to set EnableViewState to true, but my chart may have about 10000 values an so that would cost to much traffic!
- 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


