is there some way how to force asp.net (C#) webpage wait with other orders in code? I mean something like this:

1 - make something
2 - wait 5 seconds (for completing previous tasks)
3 - continue with other orders


12 Years
Discussion Span
Last Post by rpgivpgmr

Sorry, but this doesn't make sense to me. Can you post a better pseudo-code example? If you have something that needs to execute before something else happens, code the first "thing" as a method that returns a value. Test the value, then move forward or not.

There should never be a need to do what you're asking to do.


I agree. However should you need to pause the thread while another thread completes then use thread.sleep(timetosleep)


OK, I've already solved that, it was just an error in code... But however, I'll ask a different way - do we have something like timer in asp.net 2 ? Just if I want to refresh the page in some intervals?


so you want to auto refresh the page at set times?
Best way to do it is to put it in the META tag. It is the same technique as an auto redirect to another page, only this time you are reloading your own page.

You can either code this in the markup when you design it or you can add it later in code when you want it.

in code you need to add the following line
Response.Write("<Meta http-equiv='REFRESH' content='20;URL=mypage.aspx' />");

and in markup you just need
<Meta http-equiv='REFRESH' content='20;URL=mypage.aspx' />

the 20 means 20 seconds, so put your own time in there. It is as simple as that

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.