Hi
I wondered if anyone knew of a "Pause" or "Delay" type piece of code I could use to delay a method execution within a method.
What I have is:-
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
MyShoppingCart usersShoppingCart = new MyShoppingCart();
String cartId = usersShoppingCart.GetShoppingCartId();
CheckOutHeader.InnerText = "Thank You - Your Order is Complete! Please wait whilst you are directed to PayPal...";
ImageButton1.Visible = false;
TotalAndOrderToPP(usersShoppingCart, cartId);
I ideally want some sort of pause or delay of say a second before the TotalAndOrderToPP is involked?
Regards
Steven
Loading
VulpesPosted May 2, 2012, 12:40 PM
System.Threading.Thread.Sleep(1000);
VulpesPosted May 2, 2012, 2:07 PM
It will then suspend the thread for a second (1000 milliseconds) before that method is invoked.
Guest UserPosted May 2, 2012, 1:41 PM
Would this be placed before the required method is to be called, in this case the TotalAndOrderToPP method?