Stale values returned by ajax

Discussion in 'C#' started by Sleeping Troll, Jul 22, 2008.

  1. #1
    I am having trouble with an ajax call, the server side code runs fine when accessed directly, This is the server side code:

    <%
    Set rs=Server.CreateObject("ADODB.RecordSet")
    rs.CursorType = 3
    rs.CursorLocation = 3
    rs.ActiveConnection = conn
    rs.open ("SELECT top 1 time FROM calls INNER JOIN cliente INNER JOIN p1 ON cliente.id_cli = p1.clie INNER JOIN p2 ON p1.id_p1 = p2.p1 INNER JOIN p3 ON p2.id_p2 = p3.p2 INNER JOIN p4 ON p3.id_p3 = p4.p3 ON calls.number = p4.c2 WHERE(cliente.id_cli = 30) order by time desc")
    Resp = rs.fields("time")
    rs.close
    Set rs = nothing
    conn.close 
    Response.Write(Resp)
    %>
    Code (markup):
    When called by Ajax script it returns "stale" values

    For example if a new record is inserted in database it will still return value of an older record. This only occurs when script is called from client.
     
    Sleeping Troll, Jul 22, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    If the ASP page works fine when called directlty, it is probably a cache problem in your browser (IE is notorious for this when working with Ajax). Try clearing your cache and restarting the browser.
     
    itcn, Jul 28, 2008 IP