Prevent Page Refresh

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Prevent Page Refresh

    How do I prevent a user from going back to a previous page, and also from
    refreshing a current page? Forgive me for my ignorance, here; but I've
    created a credit card billing page that has a form, which is processed on a
    "Thank you form", which processes through Verisign & to a SQL database.
    More than occasionally, people are being "double-billed". In some cases,
    they are refreshing the page, and other times they're returning "back" to
    the submission page, changing the "name on card" to include a middle
    initial, or something of the like and resubmitting the form. How do I
    prevent the user from doing this? Thanks in advance for your help.

    Bari


    Bari Allen Guest

  2. Similar Questions and Discussions

    1. How can I prevent a button event firing on page refresh?
      If a page has a button with event handler private void btnAdd_Click(object sender, System.EventArgs e) { ....... } this event handler fires...
    2. Prevent data insert on page refresh
      After a form is submited and inserted to the database, if the user hits the refresh button the data is again inserted to the database (there is a...
    3. Force page to refresh/prevent caching
      Greetings JGLADNICK. This is referring to your post on CFusion/WebForums of one year ado regarding "Prevent Caching". Have you ever been able to...
    4. Is there a way to prevent a screen refresh?
      Hi everyone, I have this problem where I need to change 4 images on the stage. I use 4 sprites each having a different member. The images are...
    5. Prevent 'Page has expired' when a client hits back to return to a search page
      I have a search page that I want to enable private caching so that when a user hits the back button they dont get the page has expired error. I...
  3. #2

    Default Re: Prevent Page Refresh

    You cannot prevent people from doing foolish things, but you can prevent
    posting-back by means of a refresh by not displaying any response on the
    page that processes the form data, i.e.


    pagewithform.asp--POST--pagethatprocesses.asp---REDIRECT---pagewiththankyou.
    asp

    If the person refreshes, all he'll get is the thank you page again.

    Aside from that, you'll have to check for double postings in code on the
    server.

    Ray at work

    "Bari Allen" <bari@sos.REMOVETHIS.state.ga.us> wrote in message
    news:%23o4OvlJUDHA.2228@tk2msftngp13.phx.gbl...
    > How do I prevent a user from going back to a previous page, and also from
    > refreshing a current page? Forgive me for my ignorance, here; but I've
    > created a credit card billing page that has a form, which is processed on
    a
    > "Thank you form", which processes through Verisign & to a SQL database.
    > More than occasionally, people are being "double-billed". In some cases,
    > they are refreshing the page, and other times they're returning "back" to
    > the submission page, changing the "name on card" to include a middle
    > initial, or something of the like and resubmitting the form. How do I
    > prevent the user from doing this? Thanks in advance for your help.
    >
    > Bari
    >
    >

    Ray at Guest

  4. #3

    Default Re: Prevent Page Refresh

    I'm looking at all of your suggestions. Thank you. The session code would
    also be helpful, if you would post it :)
    Bari

    "John Beschler" <giles@geewhiz.com> wrote in message
    news:007201c351f9$09971a30$a301280a@phx.gbl...
    > I had a similiar problem with one of my sites. What I did
    > was store a session variable that controlled whether the
    > page would load or not. As soon as the user clicked the
    > submit button, I changed the session variable to prevent
    > the page from reloading. If you need the details leave a
    > note here and I'll pull the code and post it.
    >
    > John
    >
    >
    >
    >
    > >-----Original Message-----
    > >How do I prevent a user from going back to a previous
    > page, and also from
    > >refreshing a current page? Forgive me for my ignorance,
    > here; but I've
    > >created a credit card billing page that has a form, which
    > is processed on a
    > >"Thank you form", which processes through Verisign & to a
    > SQL database.
    > >More than occasionally, people are being "double-
    > billed". In some cases,
    > >they are refreshing the page, and other times they're
    > returning "back" to
    > >the submission page, changing the "name on card" to
    > include a middle
    > >initial, or something of the like and resubmitting the
    > form. How do I
    > >prevent the user from doing this? Thanks in advance for
    > your help.
    > >
    > >Bari
    > >
    > >
    > >.
    > >

    Bari Allen Guest

  5. #4

    Default Re: Prevent Page Refresh

    In the form page (data entry)
    Session("OK2Pro") = True

    In the process page:
    if Session("OK2Pro") <> true then
    response.redirect("default.asp")
    else
    Session("OK2Pro") = False
    End if


    When the user clicks the submit button, the first thing
    the process page does is set the session variable to
    False. Then if the user clicks the back button, Session
    ("OK2Pro") will be false and the user will be redirected
    to the main page if they click submit a second time.

    This also prevents the user from updating data on the
    server if they leave their browser open on the form page
    for longer than the session timeout value. Since Session
    ("OK2Pro") will be empty after session timeout, the user
    will be redirected to the main page.


    >-----Original Message-----
    >I'm looking at all of your suggestions. Thank you. The
    session code would
    >also be helpful, if you would post it :)
    >Bari
    >
    >"John Beschler" <giles@geewhiz.com> wrote in message
    >news:007201c351f9$09971a30$a301280a@phx.gbl...
    >> I had a similiar problem with one of my sites. What I
    did
    >> was store a session variable that controlled whether the
    >> page would load or not. As soon as the user clicked the
    >> submit button, I changed the session variable to prevent
    >> the page from reloading. If you need the details leave a
    >> note here and I'll pull the code and post it.
    >>
    >> John
    >>
    >>
    >>
    >>
    >> >-----Original Message-----
    >> >How do I prevent a user from going back to a previous
    >> page, and also from
    >> >refreshing a current page? Forgive me for my
    ignorance,
    >> here; but I've
    >> >created a credit card billing page that has a form,
    which
    >> is processed on a
    >> >"Thank you form", which processes through Verisign &
    to a
    >> SQL database.
    >> >More than occasionally, people are being "double-
    >> billed". In some cases,
    >> >they are refreshing the page, and other times they're
    >> returning "back" to
    >> >the submission page, changing the "name on card" to
    >> include a middle
    >> >initial, or something of the like and resubmitting the
    >> form. How do I
    >> >prevent the user from doing this? Thanks in advance
    for
    >> your help.
    >> >
    >> >Bari
    >> >
    >> >
    >> >.
    >> >
    >
    >
    >.
    >
    John Beschler Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139