Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i do a delay in my asp code?

Status
Not open for further replies.

marcela24

Programmer
Feb 17, 2003
72
NL
Is there a way to make a delay or a sleep in the middle of my asp code?
 
[tt]Can you be specific as to what you're looking for?


But if you're trying to re-direct a page in a specific amount of time, here's some helpful code

------------------------------------------------
<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

redirTime = &quot;15000&quot;;
redirURL = &quot;your_page.asp&quot;;
function redirTimer() { self.setTimeout(&quot;self.location.href = redirURL;&quot;,redirTime); }
</script>


<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->

<BODY onLoad=&quot;redirTimer()&quot;>
------------------------------------------------

If this is not what you're looking for, ignore my code.

P.S. this code will re-direct in 15 seconds which can be changed of course...





Delete * from brain Where MaxLevel = &quot;Full&quot; and reaction = &quot;Slow&quot; order by StartOver
 
Sorry, but it´s not it.

I´ll try to be more specific:
' Opens the connection to the remote server.
objXml.Open &quot;POST&quot;, &quot; False

'First iam opening a connection with a remote server.
'Now i want to cause a delay here. And after 5 seconds ill do another connection with a remote server. But ill have to wait 5 seconds before i do that.
 
Firing sleep statements is generally a bad idea because it is tying up your web server and making it do more work than should be necessary. If your using the XMLHTTP it would probably be beter to just put your script in a loop to wait until the you get a full response (look at the status property for XMLHTTP object).

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top