Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Islamabad
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Restrict Resfresh Option

    Dear friends
    I have two questions

    1) How can we restrict refresh option? I donot want that when page is displayed some one can refresh it. As i do insertion there. Primary key is inserted automatically by getting max number and incremented by 1. so by refreshing the insertion is done again.

    2) Before using the Response.redirect i want to give pause for 10 seconds. How can I do that.
    Thanks
    ENGR IRFAN HAIDER JAFFERY
    BE CIVIL, MCS (STUDENT)
    ISALAMABAD

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    about your first question :
    - one way to dot it is work with a session variable (say update), that innitially is set to "0" (for exapmle in your global.asa) and that is set to "1" after the insertion. for example after running a verification like

    dim inserted 'variable used as parameter in following statement
    conTest.Execute sql,inserted
    if inserted >=1 then
    update=1
    end if

    and in the top of your body you enter a verification like


    if update=1 then
    response.write("You can't refresh this page blablabla")
    else
    ....
    end if

    so if a user then refreshes the page, he will onlu get this mesage
    when he goes to another 'asp) page, you can set the update-variable back to "0" an reuse this variable for other insert-pages

    - another way is to rederict if update=1
    about your second question :

    it depends whether you want to do this on the userside or the serversite. i think it's best to do this on the users side, so you can show a "waiting" text. if so, use the javascript "onload" function.

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    Islamabad
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    att raf

    DEAR RAF
    DO YOU KKNOW JAVASCRIPT FUNCTION WHICH SHOW A MESSAGE WAIT FOE SOME SECONG AND THEN REDIRECT.
    ENGR IRFAN HAIDER JAFFERY
    BE CIVIL, MCS (STUDENT)
    ISALAMABAD

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you find one at this url

    http://javascriptkit.com/script/cut168.shtml

    it looks nice, with an extra feature (timecountdown in the status bar) url contains source + instructions to modify and insert into your page.

    oh yeah : the "message" is then your html page where you insert this script in.

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.askasp.com/articles.asp?ArtID=85

    <%
    ' Get Start Time
    StartTime = Timer()

    'Get End Time
    EndTime = Timer()

    'Determine how long it took
    WaitTime = EndTime - StartTime

    'Continue checking the elapsed time until it reaches 10 seconds
    do while WaitTime < 10
    'Get End Time
    EndTime = Timer()

    'Determine how long it took
    WaitTime = EndTime - StartTime
    loop

    'Redirect user, since we know that it has been more than 10 seconds
    Response.Redirect "page2.asp"
    %>
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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