Forward Posted Form Data

Discussion in 'ASP General' started by Mark Watkins, Jan 5, 2004.

  1. Mark Watkins

    Mark Watkins Guest

    suppose I have the following:

    -----------BEGIN page1.asp----------
    <form method="post" action="page2.asp">
    <select name="someData" size="1" class="smallbutton">
    <option value="1">Whatever</option>
    </select>
    'and a submit button
    </form>
    ----------END page1.asp--------------

    -----------BEGIN page2.asp----------
    aVariable = Request.Form("someData")

    <form method="post" action="page3.asp">
    <select name="someOtheJjunk" size="1" class="smallbutton">
    <option value="1">Whatever</option>
    </select>
    'and a submit button
    </form>
    ----------END page2.asp--------------

    Is there any kind of way to forward "someData", whch was
    posted into page 2, to page 3 without making it more form data in page2. I
    pretty much want to just be able to do something simple in page 3 like this:

    -----------BEGIN page3.asp----------
    anotherVariable = Request.Form("someData")
    ----------END page3.asp--------------


    Thanks in advance.
     
    Mark Watkins, Jan 5, 2004
    #1
    1. Advertising

  2. Mark Watkins

    Roland Hall Guest

    "Mark Watkins" wrote:
    : suppose I have the following:
    :
    : -----------BEGIN page1.asp----------
    : <form method="post" action="page2.asp">
    : <select name="someData" size="1" class="smallbutton">
    : <option value="1">Whatever</option>
    : </select>
    : 'and a submit button
    : </form>
    : ----------END page1.asp--------------
    :
    : -----------BEGIN page2.asp----------
    : aVariable = Request.Form("someData")
    :
    : <form method="post" action="page3.asp">
    : <select name="someOtheJjunk" size="1" class="smallbutton">
    : <option value="1">Whatever</option>
    : </select>
    : 'and a submit button
    : </form>
    : ----------END page2.asp--------------
    :
    : Is there any kind of way to forward "someData", whch was
    : posted into page 2, to page 3 without making it more form data in page2.
    I
    : pretty much want to just be able to do something simple in page 3 like
    this:
    :
    : -----------BEGIN page3.asp----------
    : anotherVariable = Request.Form("someData")
    : ----------END page3.asp--------------

    You cannot retrieve a variable's value from a page header by using
    Request.Form any other way than METHOD=POST from a form where ACTION=
    targets the page you're retrieving. So, I see two possibilities without
    using cookies, files, etc.

    Hidden field inside a form.

    page2.asp
    .... inside form ...
    <input id="someData" name="someData" type=hidden value="<%=aVariable%>" />

    OR

    You could use a session variable.

    page2.asp
    Session("aVariable") = Request.Form("someData")

    page3.asp
    anotherVariable = Session("aVariable")

    --
    Roland

    This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose.
    -Technet Knowledge Base-
    http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
    -Technet Script Center-
    http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp
    -MSDN Library-
    http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Jan 5, 2004
    #2
    1. Advertising

  3. Mark Watkins

    Alex G Guest

    If you want to use Request.Form in page 3 then you will have to
    forward it using form variables. If you don't need to use Request.Form
    you could use Session Variables.

    "Mark Watkins" <> wrote in message news:<#>...
    > suppose I have the following:
    >
    > -----------BEGIN page1.asp----------
    > <form method="post" action="page2.asp">
    > <select name="someData" size="1" class="smallbutton">
    > <option value="1">Whatever</option>
    > </select>
    > 'and a submit button
    > </form>
    > ----------END page1.asp--------------
    >
    > -----------BEGIN page2.asp----------
    > aVariable = Request.Form("someData")
    >
    > <form method="post" action="page3.asp">
    > <select name="someOtheJjunk" size="1" class="smallbutton">
    > <option value="1">Whatever</option>
    > </select>
    > 'and a submit button
    > </form>
    > ----------END page2.asp--------------
    >
    > Is there any kind of way to forward "someData", whch was
    > posted into page 2, to page 3 without making it more form data in page2. I
    > pretty much want to just be able to do something simple in page 3 like this:
    >
    > -----------BEGIN page3.asp----------
    > anotherVariable = Request.Form("someData")
    > ----------END page3.asp--------------
    >
    >
    > Thanks in advance.
     
    Alex G, Jan 5, 2004
    #3
    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. Mark
    Replies:
    1
    Views:
    537
    Joe Smith
    Jul 23, 2004
  2. Arpan

    No. Of Times Form Posted

    Arpan, Dec 5, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    317
    Jeffrey Palermo [MCP]
    Dec 6, 2004
  3. qazmlp
    Replies:
    1
    Views:
    616
    Jonathan Turkanis
    Feb 15, 2004
  4. Umeshnath

    download an image POSTed By multipart form-data

    Umeshnath, Aug 11, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    1,142
    Umeshnath
    Aug 11, 2009
  5. Replies:
    7
    Views:
    285
    A. Sinan Unur
    Feb 14, 2006
Loading...

Share This Page