Hi,
 
I am trying to handle a piece of MSMQ asynchronous from a web application.
I have the following piece of code that is in the code behind of a user control 
in an eventhandler
 
 ReloadCart();
 OrderCalculatedHandler resultHandler = new 
OrderCalculatedHandler(ResultHandler);
_msmqAdapter.CalculateOrder(_cart, resultHandler);
Profile.ShoppingCart = _cart;
RetrieveOrderFromProfile();
 
The line _msmqAdapter.CalculateOrder(_cart, resultHandler); is the line that 
calls the asynchronous method.  resultHandler is function pointer to the 
following piece of code:
 
private void ResultHandler(object sender, MSMQEventArguments<ShoppingCart> e)
{
    _cart = e.Result;
    Profile.ShoppingCart = _cart;
}
 
The problem being that the method takes a long time to run and the page 
finishes processing before an event is raised back to the page.
 
What can I do to tell the page to wait for the ResultHandler method to execute?
 
Thanks
Paul
===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to