Passing Variables Between ASP Pages using POST

Discussion in 'ASP General' started by David E, May 18, 2005.

  1. David E

    David E Guest

    Hello

    I having trouble with this action cause I want the user to be able to
    use the back button and the submitted data should be still in their
    form. So I the user send invalid data he can back browse and change
    the invalid data. I use method=POST cause its a lot of data i send
    between pages + client is IE6.

    Some information here:
    http://www.4guysfromrolla.com/webtech/faq/Intermediate/faq5.shtml

    Right now i experiment with POST to it self then submit to the next
    page but I can get it to work.

    Anyone knows how to do this or is it impossible?

    TIA

    David E
    David E, May 18, 2005
    #1
    1. Advertising

  2. Eliminate the next page and just post the form to itself. What I often do
    is something like:

    <%
    ''validation of some sort
    If Request.Form("input1") = "specific" and Request.Form("input2") = "text"
    Then
    '''your code that does what you need
    Response.Redirect "thankyou.asp"
    End If
    %>

    <form method="post" action="thissamepage.asp">
    <input name="input1" value="<%=f("input1")%>">
    <input name="input2" value="<%=f("input2")%>">
    <input type="submit">
    </form>
    <%
    Function f(x)
    f = Server.HTMLEncode(Request.Form(x))
    End Function
    %>

    Ray at work


    "David E" <> wrote in message
    news:...
    > Hello
    >
    > I having trouble with this action cause I want the user to be able to
    > use the back button and the submitted data should be still in their
    > form. So I the user send invalid data he can back browse and change
    > the invalid data. I use method=POST cause its a lot of data i send
    > between pages + client is IE6.
    >
    > Some information here:
    > http://www.4guysfromrolla.com/webtech/faq/Intermediate/faq5.shtml
    >
    > Right now i experiment with POST to it self then submit to the next
    > page but I can get it to work.
    >
    > Anyone knows how to do this or is it impossible?
    >
    > TIA
    >
    > David E
    Ray Costanzo [MVP], May 18, 2005
    #2
    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. Replies:
    2
    Views:
    556
    Eliyahu Goldin
    May 31, 2005
  2. Replies:
    1
    Views:
    3,190
    PeterKellner
    May 16, 2006
  3. roo
    Replies:
    2
    Views:
    356
  4. RadioSignal

    passing variables from .aspx.cs code pages to .aspx pages

    RadioSignal, Sep 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    2,188
    Mirronelli
    Oct 22, 2005
  5. williamroy
    Replies:
    1
    Views:
    121
    Joshie Surber
    Nov 18, 2005
Loading...

Share This Page