Aborting a Request?

  • Thread starter Thread starter Jeffrey A. Voigt
  • Start date Start date
J

Jeffrey A. Voigt

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
 
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
 
Beautiful!
Thanks!

Martin Dechev said:
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
 
Back
Top