the response of Ajax is not updated

Hi
I am developing a Asp.net Application using Ajax..
here i call tha Ajax:  url = "http://localhost:49674/test/LastPosition.aspx?name=test&userid=1"       
xmlHttp.open("GET",url,true);  
and my response will be like this:
<?xml version="1.0" encoding="UTF-8" ?>
- <NewDataSet>
- <Table>
  <TrackID>31546</TrackID>
  <UnitID>1010010033</UnitID>
  <Lon>144</Lon>
  <Lat>-37.5</Lat>
  <Speed>14</Speed>
  <_DateTIME>20101000000000</_DateTIME>
  <Heading>100</Heading>
  </Table>
  </NewDataSet>

but the problem is: if i launch 'http://localhost:49674/test/LastPosition.aspx?name=test&userid=1' in internet explorer  I get the last record inserted in database

but in javascript code when i receeive the ajax response i still get the old record..
please help
 there is my LastPosition.aspx code:
protected void Page_Load(object sender, EventArgs e)
    {
       name = Request.QueryString["name"];
       userid = Convert.ToInt16(Request.QueryString["userid"]);
       ds = this.busLayertracking.GetDeviceLastPosition(userid, name);
       XmlDocument doc = new XmlDocument();       
       doc.LoadXml(ds.GetXml());
       XmlDeclaration xmldecl;
       xmldecl = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
       XmlElement root = doc.DocumentElement;
       doc.InsertBefore(xmldecl, root);
       Response.Clear();
       Response.ClearContent();
       Response.ContentType = "text/xml";
       doc.Save(Response.OutputStream);
       Response.End();
    }

Open in new window

klay8Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David S.Commented:
It sounds like you've run into IE's tendency to cache AJAX responses.

One solution would be to add a pseudo-random string to the end of each URL:

url = 'http://localhost:49674/test/LastPosition.aspx?name=test&userid=1&'+(new Date()).getTime();

More information (be sure to read the first comment): http://weblogs.asp.net/pleloup/archive/2006/06/08/451583.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.