By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

Display 'In Process' page when calling async WebService

P: n/a
Hi all,

Can anyone give me some links about how to do an async web service call
from aspx and display a temperary page before the web service returns?

Thanks,
Homa Wong

Nov 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,

Hopefully the following link may help you.

http://msdn.microsoft.com/library/de...chronously.asp

cheers,

Jerome. M

"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service call
from aspx and display a temperary page before the web service returns?

Thanks,
Homa Wong

Nov 23 '05 #2

P: n/a
Hi,

The Following link may help you to understand beeterly about the waithandle.
I hope you can make you of this, to display the "In Process Page" during your
async call.

Cheers,

Jerome. M
"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service call
from aspx and display a temperary page before the web service returns?

Thanks,
Homa Wong

Nov 23 '05 #3

P: n/a
Hi,

The problem with ASP.NET is when a "In Progress page" is displayed, the
HttpContext already end response, i.e., all information are sent to the
client. So when a callback returns, nothing more can be written to the
client's browser. And if I do a redirect, it result an error because
the code behind class doesn't know which browser it should communicate
to (because it ended response to the browser thus the client browser is
in a "disconnected" state).
I can think of two ways to do this.

1. Use JavaScript.
Have a timed redirect script inject to the "In Progress page." When
times up, the page redirects to the result page and if the result is
not ready, it goes back to the "In progress page" and wait again until
the result is ready (or timeout). The problem of this is the timed
parameter is fixed because you don't know in real time how long will
the web service take to return your call. So in the worst case it takes
twice as long to get the result (of course, this can be reduced but
it's kind of like a passive fix to the problem).

2. Tell the "In progress page" to send part of the page to the client
browser while waiting for the result. This would be ideal but I don't
know how to do it.

I don't have much problem dealing with async call directly, but how the
Page and the Client browser interact to get the solution works.

The solution I want is like the bank websites that after you login, it
display a page saying "We are gathering your information..." and then
direct you to summary page of your bank account.

Thanks,
Homa Wong

DotNetJerome wrote:
Hi,

The Following link may help you to understand beeterly about the waithandle. I hope you can make you of this, to display the "In Process Page" during your async call.

Cheers,

Jerome. M
"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service call from aspx and display a temperary page before the web service returns?
Thanks,
Homa Wong


Nov 23 '05 #4

P: n/a
I've never done this before but I imagine you need Response.Flush... something
like this.

private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Wait 4 Seconds...<BR><BR>");
Response.Flush();

System.Threading.Thread.SpinWait(99999999);

Response.Write("4 seconds is up. Redirecting in 4 seconds to google.com");
Response.Flush();

System.Threading.Thread.SpinWait(99999999);
Response.Write("<script>window.location='http://www.google.com';</script>");
Response.End();
}

For some reason this code I have posted doesn't totally work cause sometimes
the 'wait 4 seconds' message doesn't show up. Its just to give you an idea
and you can play around with it.

http://blogs.msdn.com/nunos/archive/....aspx#FeedBack might
help you.

-Trevor
Hi,

The problem with ASP.NET is when a "In Progress page" is displayed,
the
HttpContext already end response, i.e., all information are sent to
the
client. So when a callback returns, nothing more can be written to the
client's browser. And if I do a redirect, it result an error because
the code behind class doesn't know which browser it should communicate
to (because it ended response to the browser thus the client browser
is
in a "disconnected" state).
I can think of two ways to do this.
1. Use JavaScript.
Have a timed redirect script inject to the "In Progress page." When
times up, the page redirects to the result page and if the result is
not ready, it goes back to the "In progress page" and wait again until
the result is ready (or timeout). The problem of this is the timed
parameter is fixed because you don't know in real time how long will
the web service take to return your call. So in the worst case it
takes twice as long to get the result (of course, this can be reduced
but it's kind of like a passive fix to the problem).

2. Tell the "In progress page" to send part of the page to the client
browser while waiting for the result. This would be ideal but I don't
know how to do it.

I don't have much problem dealing with async call directly, but how
the Page and the Client browser interact to get the solution works.

The solution I want is like the bank websites that after you login, it
display a page saying "We are gathering your information..." and then
direct you to summary page of your bank account.

Thanks,
Homa Wong
DotNetJerome wrote:
Hi,

The Following link may help you to understand beeterly about the

waithandle.
I hope you can make you of this, to display the "In Process Page"

during your
async call.

Cheers,

Jerome. M
"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service
call
from aspx and display a temperary page before the web service
returns?
Thanks,
Homa Wong


Nov 23 '05 #5

P: n/a
Hi,
I actually found the solution. Here is the link.

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Cheers,
Homa Wong

Trevor Pinkney wrote:
I've never done this before but I imagine you need Response.Flush... something like this.

private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Wait 4 Seconds...<BR><BR>");
Response.Flush();

System.Threading.Thread.SpinWait(99999999);

Response.Write("4 seconds is up. Redirecting in 4 seconds to google.com"); Response.Flush();

System.Threading.Thread.SpinWait(99999999);
Response.Write("<script>window.location='http://www.google.com';</script>"); Response.End();
}

For some reason this code I have posted doesn't totally work cause sometimes the 'wait 4 seconds' message doesn't show up. Its just to give you an idea and you can play around with it.

http://blogs.msdn.com/nunos/archive/....aspx#FeedBack might help you.

-Trevor
Hi,

The problem with ASP.NET is when a "In Progress page" is displayed,
the
HttpContext already end response, i.e., all information are sent to
the
client. So when a callback returns, nothing more can be written to the client's browser. And if I do a redirect, it result an error because the code behind class doesn't know which browser it should communicate to (because it ended response to the browser thus the client browser is
in a "disconnected" state).
I can think of two ways to do this.
1. Use JavaScript.
Have a timed redirect script inject to the "In Progress page." When
times up, the page redirects to the result page and if the result is not ready, it goes back to the "In progress page" and wait again until the result is ready (or timeout). The problem of this is the timed
parameter is fixed because you don't know in real time how long will the web service take to return your call. So in the worst case it
takes twice as long to get the result (of course, this can be reduced but it's kind of like a passive fix to the problem).

2. Tell the "In progress page" to send part of the page to the client browser while waiting for the result. This would be ideal but I don't know how to do it.

I don't have much problem dealing with async call directly, but how
the Page and the Client browser interact to get the solution works.

The solution I want is like the bank websites that after you login, it display a page saying "We are gathering your information..." and then direct you to summary page of your bank account.

Thanks,
Homa Wong
DotNetJerome wrote:
Hi,

The Following link may help you to understand beeterly about the

waithandle.
I hope you can make you of this, to display the "In Process Page"

during your
async call.

Cheers,

Jerome. M
"Homa" wrote:
Hi all,

Can anyone give me some links about how to do an async web service

call
from aspx and display a temperary page before the web service

returns?
Thanks,
Homa Wong


Nov 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.