XMLhttp request problem

Discussion in 'ASP .Net Web Controls' started by SudhaGSD, Oct 12, 2005.

  1. SudhaGSD

    SudhaGSD Guest

    Hi all


    i am using asp.net v2.0


    In one of my page i am calling another page using xml http , this is
    working fine but first time only ,


    I am sending the request on click of button , when i click the button
    second time, it's returning the previous response and it's not even
    calling that page again, where could be the problem.


    client side (aspx page 1- javascript)


    var http=new ActiveXObject("Msxml2.XMLHTTP");
    http.open("GET","Gensparql.aspx",false);
    http.send();
    if(http.readyState == 4)
    {
    if(http.responseText!=null && http.responseText!='' )
    {
    //my process
    }



    }


    server side (aspx page 2)

    Response.Clear();
    Response.ContentType = "text/xml";
    Response.Write(retVal);
    Response.End();


    //second time returning same previous output and not calling the aspx
    page 2
    Hope u understand my problem,i am in urgent, Thanks in advance
     
    SudhaGSD, Oct 12, 2005
    #1
    1. Advertising

  2. SudhaGSD

    Milsnips Guest

    i had the same problem! the way i solved it was the following:

    in the page_load of the aspx page with the javascript, add this:

    --------------------
    Response.Cache.SetCacheability(HttpCacheability.NoCache)
    ---------------------
    seems that it holds the first call in cache, might be some bug or something,
    but anyway this doesnt allow it to store in cache, therefore calling the
    aspx page everytime.

    hope it works,
    Paul

    "SudhaGSD" <> wrote in message
    news:...
    > Hi all
    >
    >
    > i am using asp.net v2.0
    >
    >
    > In one of my page i am calling another page using xml http , this is
    > working fine but first time only ,
    >
    >
    > I am sending the request on click of button , when i click the button
    > second time, it's returning the previous response and it's not even
    > calling that page again, where could be the problem.
    >
    >
    > client side (aspx page 1- javascript)
    >
    >
    > var http=new ActiveXObject("Msxml2.XMLHTTP");
    > http.open("GET","Gensparql.aspx",false);
    > http.send();
    > if(http.readyState == 4)
    > {
    > if(http.responseText!=null && http.responseText!='' )
    > {
    > //my process
    > }
    >
    >
    >
    > }
    >
    >
    > server side (aspx page 2)
    >
    > Response.Clear();
    > Response.ContentType = "text/xml";
    > Response.Write(retVal);
    > Response.End();
    >
    >
    > //second time returning same previous output and not calling the aspx
    > page 2
    > Hope u understand my problem,i am in urgent, Thanks in advance
    >
     
    Milsnips, Oct 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    514
  2. Robert Cholewa

    Problem with XMLHTTP request. Please help! (long)

    Robert Cholewa, Nov 23, 2004, in forum: Javascript
    Replies:
    1
    Views:
    134
    Bradley Baumann
    Dec 19, 2004
  3. Mark

    Javascript XMLhttp request help

    Mark, Jan 27, 2005, in forum: Javascript
    Replies:
    3
    Views:
    130
    Martin Honnen
    Jan 28, 2005
  4. XMLhttp request problem

    , Oct 12, 2005, in forum: Javascript
    Replies:
    11
    Views:
    167
    Dr John Stockton
    Oct 14, 2005
  5. yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

    yawnmoth, Nov 7, 2006, in forum: Javascript
    Replies:
    11
    Views:
    410
    Matt Kruse
    Nov 9, 2006
Loading...

Share This Page