Classic ASP page - Detect if page is refreshed or redirected from another page [Answered]RSS

1 reply

Last post Jan 22, 2014 02:50 AM by Angie xu - MSFT

  • Classic ASP page - Detect if page is refreshed or redirected from another page

    Jan 21, 2014 07:32 AM|ashok.k|LINK

    Hi,

    I am working on a Classic ASP application hosted on IIS 6.  User can enter the details in Enter_details.asp page and click on send email button to receive email confirmation.  After clicking on Send email button, page is redirected to email.asp page and email is sent.

    If users refresh the email.asp page, a duplicate email is sent with the same details. How to check if an ASP page is redirected or refreshed and avoid duplicate emails?

    Page1: Enter_Details.asp page

    <form action="email.asp" method="POST">

    <input type="Submit" name="Submitbutton" value="Send E-Mail">

    Page2: email.asp page

    code to send email goes here.

    I want to alert the user if an email is already sent.

    How to check if an ASP page is redirected or refreshed?

    Thanks
    Ashok

  • Re: Classic ASP page - Detect if page is refreshed or redirected from another page

    Jan 22, 2014 02:50 AM|Angie xu - MSFT|LINK

    Hi ashok

    You can write your own IsPostBack Function in ASP,

    Function IsPostBack()

         If Request.Form("submit") <> Empty Then

              Return True

              Else

              Return False

         End If

    End Function

    Best regards

    Angie

    Angie xu

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.