473,388 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Aborting a Request?

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
Nov 18 '05 #1
2 982
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" <vo***********@myfloridahouse.com> wrote in message
news:#O**************@TK2MSFTNGP09.phx.gbl...
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

Nov 18 '05 #2
Beautiful!
Thanks!

"Martin Dechev" <de*******@hotmail.com> wrote in message
news:Oj****************@TK2MSFTNGP11.phx.gbl...
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" <vo***********@myfloridahouse.com> wrote in message
news:#O**************@TK2MSFTNGP09.phx.gbl...
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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: 11abacus | last post by:
Hi all, I wonder if this is possible: I have a script that does things that take time. In the first part of the script it does data checking and other verifications, then comes the long part. I...
0
by: Jason | last post by:
I have a job created on my server which runs a stored procedure. The SP uses a cursor on a recordset to insert rows into a table (via a stored procedure - hence the cursor). It is expected that...
1
by: K0 | last post by:
Hi everyone I have a question: I have created a small windows service and runs ok. I have a problem, tho. I would like to abort uninstalling of the service if it is currently running, so I...
3
by: Patrick De Ridder | last post by:
Given: I call Form2 from Form1. I throw an exception in Form2. A MessageBox ("Fatal error") is shown with an OK button. Question 1: I want to abort everything after pressing the OK button....
1
by: johnny | last post by:
In a multi-threaded application, say a worker thread makes an asynchronous call and specifies a callback method. But before the callback is executed, the thread is aborted by its creator. What is...
2
by: Xarky | last post by:
Hi, I am writing a small program, that makes use of threads. Now in on of the threads I have a critical section, where I am using the Monitor to handle this. *** Thread_1 *** started for(...)...
7
by: Jerry Camel | last post by:
The following code throws a "Thread was being aborted" exception at the Response.End line. Even if I catch the exception, the code that follows is never executed. (Because the thread was being...
7
by: archana | last post by:
Hi all, I am having application in which i am doing asynchronous call.I am using manualresetevent to wait for asynchronous call to complete. I want to stop asynchronous call after certain...
2
by: cookspyder | last post by:
I have a simple socket client code that sends the contents of a syslog over to a server when it finds an error. It has been working fine in a while loop of read open socket send line and close...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.