Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Aborting a Request?

Reply
Thread Tools

Aborting a Request?

 
 
Jeffrey A. Voigt
Guest
Posts: n/a
 
      02-23-2004
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


 
Reply With Quote
 
 
 
 
Martin Dechev
Guest
Posts: n/a
 
      02-23-2004
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" <(E-Mail Removed)> wrote in message
news:#OxOHrh#(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Jeffrey A. Voigt
Guest
Posts: n/a
 
      02-23-2004
Beautiful!
Thanks!

"Martin Dechev" <(E-Mail Removed)> wrote in message
news:OjJGwOi%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:#OxOHrh#(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET Timers aborting in web application Jeff Greenland ASP .Net 3 12-18-2003 08:12 PM
Re: Aborting a _Click event? Wayne MJ ASP .Net 2 07-29-2003 05:37 AM
Aborting a _Click event? Wayne MJ ASP .Net 0 07-23-2003 05:50 AM
Aborting Fucntions Willem Oosthuizen VHDL 2 07-11-2003 11:32 AM
I need help on aborting msxml3 sax2 parser Asana MCSD 0 06-30-2003 01:02 PM



Advertisments