I am using SWFObject in a client side javascript in an aspx page. The object displays data in the form of a pie chart.
For this I am generating an xml file at run time. The file name is created runtime by using userid. The file name is passed to the client script and then the pie chart is displayed.
The details of the user are displayed properly for the first time. But when record of a user is edited in the application and then viewed, the old values are displayed in pie chart.
I want to show the updated data in pie chart at all the time. Can any one help me in figuring out what the problem is and how to rectify it?
It sounds like the xml data returned by the .aspx page is being cached, and you are getting stale data. You can ensure that the xml data is fresh by adding a unique id on the end of the call to the page such as:
http://some.com/getxmldata.aspx?uid=15348325238
You can set the unique value to anything you want. javascript/ flash's function Date.getTime() works well as it is millisecond accurate, so it is good enough for guaranteeing a unique value on a single client refresh/call.
I am generating a unique id and was passing it to the swf file in my client side javascript code. I will pass a unique id to the aspx page as you have suggested and see if it works properly.
If you pass a unique id to the swf file like some.swf?id=234589 (where id changes on each request) you will ensure the swf file does not cache and loads on every view. Is this what you actually want to happen. Isn't is just the data which changes?
If so, add the unique id to the xml generation call, and you should be all good.
You were right. I did pass the randomly generated number to the xml file at run time and I was able to see the modified and updated data in the pie chart.
I was not able to figure it out before that the xml file might be getting cached.