the response of Ajax is not updated

Posted on 2008-11-05
Last Modified: 2012-06-27
I am developing a Application using Ajax..
here i call tha Ajax:  url = "http://localhost:49674/test/LastPosition.aspx?name=test&userid=1""GET",url,true);  
and my response will be like this:
<?xml version="1.0" encoding="UTF-8" ?>
- <NewDataSet>
- <Table>

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();       


       XmlDeclaration xmldecl;

       xmldecl = doc.CreateXmlDeclaration("1.0", "UTF-8", null);

       XmlElement root = doc.DocumentElement;

       doc.InsertBefore(xmldecl, root);



       Response.ContentType = "text/xml";




Open in new window

Question by:klay8
    1 Comment
    LVL 42

    Accepted Solution

    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):

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API ( has made its way into the popular lexicon of the English language.  A few years ago, …
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now