Asynch processing in ASP.NET

T

Tim Marsden

HI

Firstly, I am new to ASP.NET and struggling with the following concepts.

I have a win form which gathers information, eg date range , product code
etc. when I press a button, a request is sent to the server (using sockets)
after the request is complete, the server calls back the win form (which is
listening on the port) with the response, and the form reacts to the
response.

I wish to duplicate this using a Web page instead of a Win Form.
I can gather and validate the info OK.

After this I wish to put out a Waiting... Page, and wait for the response
from the server. When the response is received redirect to the appropriate
results page.

How do I code my waiting page to wait for the server response. ?
Also I don't want to tie up the Web server resource.? If I need to start
another thread, how do I do this. ?
What happens is the user navigates away for the Waiting.. page. ?

Any suggestion are extremely well received.

I am using VB.NET I have seen examples of asynchronous C# projects but I
don't understand them.

Regards
Tim
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

The normal method actually fudges the process. It goes like so:

1. Write out the "waiting" code message and flush the Response
2. When you get the answer, write out a Response.Redirect (client side) to
move the user to another page. You can also do this same effect with a
"waiting layer" and a "results layer". You show the waiting layer first and
then hide it after you paint the underlying results layer. Depending on the
browsers you are hitting (ie, do you have to target Netscape and IE versions
3).

This gets you around the fact that you cannot, without writing a hook of
some sort, talk from the server to the client except through the stream.

For longer running processes, you will have to have something on the page
that you can communicate with, as the page will time out before you finish
the response.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
J

John Saunders

Tim Marsden said:
HI

Firstly, I am new to ASP.NET and struggling with the following concepts.

I have a win form which gathers information, eg date range , product code
etc. when I press a button, a request is sent to the server (using sockets)
after the request is complete, the server calls back the win form (which is
listening on the port) with the response, and the form reacts to the
response.

I wish to duplicate this using a Web page instead of a Win Form.
I can gather and validate the info OK.

After this I wish to put out a Waiting... Page, and wait for the response
from the server. When the response is received redirect to the appropriate
results page.

How do I code my waiting page to wait for the server response. ?
Also I don't want to tie up the Web server resource.? If I need to start
another thread, how do I do this. ?
What happens is the user navigates away for the Waiting.. page. ?

Any suggestion are extremely well received.

I am using VB.NET I have seen examples of asynchronous C# projects but I
don't understand them.

Check out "Indicating Progress"
http://msdn.microsoft.com/library/d...serverprogressfromaspnetclientapplication.asp
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top