expiring pages

Discussion in 'ASP General' started by Gav, Jan 2, 2004.

  1. Gav

    Gav Guest

    Hi,
    I have a form which sibmits data to another page. Trouble is when the user
    refreshes the page it resubmits all the data again.

    Is there anyway to expire the page immediatly so this cant happen??

    gav
    Gav, Jan 2, 2004
    #1
    1. Advertising

  2. Gav

    Steven Burn Guest

    <%Response.Clear%>

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    Disclaimer:
    I know I'm probably wrong, I just like taking part ;o)


    Gav <> wrote in message
    news:lgeJb.42$...
    > Hi,
    > I have a form which sibmits data to another page. Trouble is when the user
    > refreshes the page it resubmits all the data again.
    >
    > Is there anyway to expire the page immediatly so this cant happen??
    >
    > gav
    >
    >
    Steven Burn, Jan 2, 2004
    #2
    1. Advertising

  3. "Gav" wrote:
    >
    > I have a form which sibmits data to another page. Trouble
    > is when the user refreshes the page it resubmits all the
    > data again.
    >
    > Is there anyway to expire the page immediatly so this cant
    > happen??


    The process and redirect model is well suited for this. You can implement it
    with or without post-back. Here are a couple of stripped down examples:

    Process and redirect with post-back ---------------------------
    [p1.asp]
    <%
    If Request.Form.Count AND (validation criteria) > 0 Then
    { process data, assign cookie or session info }
    Response.Redirect("p2.asp")
    End If
    %>
    ...
    <FORM ACTION="p1.asp">

    [p2.asp]
    <% { read cookie/session data, process page } %>


    Process and redirect without post-back ------------------------
    [p1.asp]
    <FORM ACTION="p2.asp">

    [p2.asp]
    <%
    If (validation criteria) Then
    { process data, assign cookie or session info }
    Response.Redirect("p3.asp")
    Else
    Response.Redirect("p1.asp")
    End If
    %>

    [p3.asp]
    <% { read cookie/session data, process page } %>



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
    Dave Anderson, Jan 2, 2004
    #3
  4. Gav

    Brynn Guest

    Yeah, 3 files

    form.asp
    formaction.asp (with redirect to...)
    formconfirmation.asp

    also, then they hit the back button, it will take them back to the
    form, instead of formaction



    On Fri, 2 Jan 2004 08:29:35 -0600, "Dave Anderson"
    <> wrote:

    >"Gav" wrote:
    >>
    >> I have a form which sibmits data to another page. Trouble
    >> is when the user refreshes the page it resubmits all the
    >> data again.
    >>
    >> Is there anyway to expire the page immediatly so this cant
    >> happen??

    >
    >The process and redirect model is well suited for this. You can implement it
    >with or without post-back. Here are a couple of stripped down examples:
    >
    >Process and redirect with post-back ---------------------------
    >[p1.asp]
    ><%
    > If Request.Form.Count AND (validation criteria) > 0 Then
    > { process data, assign cookie or session info }
    > Response.Redirect("p2.asp")
    > End If
    >%>
    > ...
    > <FORM ACTION="p1.asp">
    >
    >[p2.asp]
    ><% { read cookie/session data, process page } %>
    >
    >
    >Process and redirect without post-back ------------------------
    >[p1.asp]
    > <FORM ACTION="p2.asp">
    >
    >[p2.asp]
    ><%
    > If (validation criteria) Then
    > { process data, assign cookie or session info }
    > Response.Redirect("p3.asp")
    > Else
    > Response.Redirect("p1.asp")
    > End If
    >%>
    >
    >[p3.asp]
    ><% { read cookie/session data, process page } %>
    >
    >
    >
    >--
    >Dave Anderson
    >
    >Unsolicited commercial email will be read at a cost of $500 per message. Use
    >of this email address implies consent to these terms. Please do not contact
    >me directly or ask me to contact you directly for assistance. If your
    >question is worth asking, it's worth posting.
    >
    >
    Brynn, Jan 3, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur

    Re: expiring a page

    Natty Gur, Jul 2, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    401
    Natty Gur
    Jul 2, 2003
  2. Jim Kelly

    Expiring cookies

    Jim Kelly, Aug 1, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    585
    someone
    Aug 5, 2003
  3. James

    expiring an aspx page

    James, Aug 27, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    3,136
    Kevin Spencer
    Aug 27, 2003
  4. VB Programmer

    HELP: Cookie keeps expiring!

    VB Programmer, Nov 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    415
    VB Programmer
    Nov 3, 2003
  5. Lasse
    Replies:
    0
    Views:
    68
    Lasse
    Aug 29, 2003
Loading...

Share This Page