Redirect after 10 seconds

Results 1 to 8 of 8

Thread: Redirect after 10 seconds

  1. #1
    Susanne Guest

    Default Redirect after 10 seconds

    I know this should be an easy question.<BR>So how to I do a response.redirect after a specific length of time?<BR>Thanks.

  2. #2
    Join Date
    Dec 1969
    Posts
    614

    Default RE: Redirect after 10 seconds

    &#060;META HTTP-EQUIV="Refresh" Content="10; URL=blaa/page.htm"&#062;

  3. #3
    Join Date
    Dec 1969
    Posts
    3,961

    Default RE: Redirect after 10 seconds

    Use this to wait 10 seconds:<BR>http://www.serverobjects.com/comp/waitfor.zip<BR><BR>Then redirect, but I&#039;d prefer it if you used meta tags client-side, i.e.:<BR><BR>&#060;META HTTP-EQUIV="Refresh" CONTENT="10; URL=page.asp"&#062;<BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    95

    Default RE: Redirect after 10 seconds

    Not an ASP answer but will work...you can use a meta refresh in the head of your document:<BR><BR>&#060;meta http-equiv="Refresh" content="10; url=whatever.asp"&#062;


  5. #5
    Susanne Guest

    Default RE: Redirect after 10 seconds

    Thanks for the meta info, but I don&#039;t think this will work in what I&#039;m doing.<BR>I have a sub in my page which is called to delete a record in a database, after doing this I want the subroutine to redirect back to my welcome page. Hope this makes sense.<BR>Any ideas?<BR>S.

  6. #6
    Join Date
    Dec 1969
    Posts
    699

    Default how about...

    ... just putting the redirect after the database update:<BR><BR>SUB deleteRecord<BR>&#039;<BR>&#039;..update database<BR>server.transfer("welcome.asp") &#060;-- for IIS 5.0<BR><BR>response.redirect("welcome.asp") &#060;-- for IIS 4.0<BR><BR>end sub<BR><BR>

  7. #7
    k1000o Guest

    Default RE: Redirect after 10 seconds

    If your idea is to redirect to a page or another depending on the branch your page You can try a JavaScript inbetween your IF branches. i.e:<BR><BR>&#060;%<BR>&#039;code<BR>&#039;code<BR >&#039;code<BR>IF A Then %&#062;<BR> &#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR> &#060;!--<BR> setTimeout "document.location=&#039;page-if-a.asp&#039;;",3000);<BR> //--&#062;<BR> &#060;/SCRIPT&#062;<BR>&#060;% Else %&#062;<BR> &#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR> &#060;!--<BR> setTimeout "document.location=&#039;page-if-NOT-a.asp&#039;;",3000);<BR> //--&#062;<BR> &#060;/SCRIPT&#062;<BR>&#060;% END IF %&#062;<BR><BR><BR>NOTE: 3000 is the time in ms = 3 seconds<BR>

  8. #8
    Susanne Guest

    Default RE: setTimeout (javascript OR VBScript)

    Thanks for the info, but I just couldn&#039;t get this to work.<BR>I tried:<BR>%&#062;<BR>&#060;SCRIPT LANGUAGE="VBScript"&#062;<BR>window.setTimeout("re directsub",5000)<BR>&#060;/SCRIPT&#062;<BR>&#060;%<BR>sub redirectsub<BR>Response.redirect "Welcome.asp"<BR>end sub%&#062;<BR><BR>Which failed with the error:<BR>can&#039;t use parentheses when calling a sub.<BR><BR>I also tried the Javascript suggestion:<BR>%&#062;<BR>&#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR>&#060;!--<BR>setTimeout"document.location=&#039;Welcome.asp &#039;;",5000);<BR>//--&#062;<BR>&#060;/SCRIPT&#062;<BR>That gets the error:<BR>Expected";"<BR><BR>Any ideas most appreciated!<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


More ASP Resources

Resources:
-- ASP Articles
-- ASP.NET Information
-- 4Guys ASP F.A.Q.
-- ASPFAQs.com
-- ASP Coding Tips
-- Related Web Technologies
-- User Tips!!
-- JavaScripts


Development Centers
-- HTML5 Development Center
-- Windows Mobile Development Center
-- Android Development Center
-- Cloud Development Project Center


Development Technology
Check out these sites for more articles, tutorials, FAQs, discussions, and code!
-- CodeGuru.com
-- VBForums.com
-- DevX.com
-- Developer.com
-- HTMLGoodies