Aborting a Request?

Discussion in 'ASP .Net' started by Jeffrey A. Voigt, Feb 23, 2004.

  1. Is there any way (when there is a post back or whatever) to abort it so that
    the client (IE) just stops waiting on the request? Basically, I want to
    check some values in a database each time a postback happens, but if some
    values have not changed.. I don't want it to appear to the user that a
    refresh has happened.

    I know I could solve this (perhaps) by setting the SmartNav to true, but I
    can't rely on my users having the latest IE browser.

    Please let me know if this can be done, or if the question is not understood
    :)

    Thanks,
    - jv
     
    Jeffrey A. Voigt, Feb 23, 2004
    #1
    1. Advertising

  2. Hi, Jeffrey A. Voigt,

    I can't tell you if it is good solution, but I just tested it and it seems
    to do partly what you need. When there is no new content you can set the
    StatusCode of the Response to 204 (No Content) and call Response.End().
    Still there will be a post to the server, but the browser (IE6 in my case)
    remains on the same page (with no changes to the content) and it receives
    only the headers:

    HTTP/1.1 204 No Content
    ....

    The code (in C#) should be something like:

    if(ThereAreSomeChanges())
    {
    // display the changes
    }
    else
    {
    Response.StatusCode = 204;
    Response.End();
    }

    Greetings
    Martin
    "Jeffrey A. Voigt" <> wrote in message
    news:#OxOHrh#...
    > Is there any way (when there is a post back or whatever) to abort it so

    that
    > the client (IE) just stops waiting on the request? Basically, I want to
    > check some values in a database each time a postback happens, but if some
    > values have not changed.. I don't want it to appear to the user that a
    > refresh has happened.
    >
    > I know I could solve this (perhaps) by setting the SmartNav to true, but I
    > can't rely on my users having the latest IE browser.
    >
    > Please let me know if this can be done, or if the question is not

    understood
    > :)
    >
    > Thanks,
    > - jv
    >
    >
     
    Martin Dechev, Feb 23, 2004
    #2
    1. Advertising

  3. Beautiful!
    Thanks!

    "Martin Dechev" <> wrote in message
    news:OjJGwOi%...
    > Hi, Jeffrey A. Voigt,
    >
    > I can't tell you if it is good solution, but I just tested it and it seems
    > to do partly what you need. When there is no new content you can set the
    > StatusCode of the Response to 204 (No Content) and call Response.End().
    > Still there will be a post to the server, but the browser (IE6 in my case)
    > remains on the same page (with no changes to the content) and it receives
    > only the headers:
    >
    > HTTP/1.1 204 No Content
    > ...
    >
    > The code (in C#) should be something like:
    >
    > if(ThereAreSomeChanges())
    > {
    > // display the changes
    > }
    > else
    > {
    > Response.StatusCode = 204;
    > Response.End();
    > }
    >
    > Greetings
    > Martin
    > "Jeffrey A. Voigt" <> wrote in message
    > news:#OxOHrh#...
    > > Is there any way (when there is a post back or whatever) to abort it so

    > that
    > > the client (IE) just stops waiting on the request? Basically, I want to
    > > check some values in a database each time a postback happens, but if

    some
    > > values have not changed.. I don't want it to appear to the user that a
    > > refresh has happened.
    > >
    > > I know I could solve this (perhaps) by setting the SmartNav to true, but

    I
    > > can't rely on my users having the latest IE browser.
    > >
    > > Please let me know if this can be done, or if the question is not

    > understood
    > > :)
    > >
    > > Thanks,
    > > - jv
    > >
    > >

    >
    >
     
    Jeffrey A. Voigt, Feb 23, 2004
    #3
    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. Willem Oosthuizen

    Aborting Fucntions

    Willem Oosthuizen, Jul 10, 2003, in forum: VHDL
    Replies:
    2
    Views:
    1,064
  2. Wayne MJ

    Aborting a _Click event?

    Wayne MJ, Jul 23, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    398
    Wayne MJ
    Jul 23, 2003
  3. Wayne MJ

    Re: Aborting a _Click event?

    Wayne MJ, Jul 25, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    514
    Wayne MJ
    Jul 29, 2003
  4. Jeff Greenland

    .NET Timers aborting in web application

    Jeff Greenland, Dec 18, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    581
    Jeff Greenland
    Dec 18, 2003
  5. Jerry Camel

    Stop aborting my thread!

    Jerry Camel, Feb 25, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    613
    Kevin Spencer
    Feb 26, 2004
Loading...

Share This Page