Forwarding the Request.Form collection

Discussion in 'ASP General' started by Agoston Bejo, Nov 22, 2004.

  1. Agoston Bejo

    Agoston Bejo Guest

    Hi.

    x1.asp:
    <form method="post" action="x2.asp"> .... </form>

    x2.asp:
    DoSomeAdministration()
    Response.Redirect "x3.asp?" & Request.Form

    x3.asp: further processsing of data


    This scenario works for a certain amount of data, but passing data in
    Request.QueryString has its limits.
    Is there any other way so that x3.asp can retrieve the data posted in
    x1.asp? I could put the textual representation of Request.Form into a
    session variable, but it would be much easier if I could pass on
    Request.Form so that x3.asp would be able to access it the same way as it
    could if x1.asp posted directly to x3.asp.
    Agoston Bejo, Nov 22, 2004
    #1
    1. Advertising

  2. You can use hidden fields to do this, redirecting from x2 to x3 with java
    script.

    "Agoston Bejo" wrote:

    > Hi.
    >
    > x1.asp:
    > <form method="post" action="x2.asp"> .... </form>
    >
    > x2.asp:
    > DoSomeAdministration()
    > Response.Redirect "x3.asp?" & Request.Form
    >
    > x3.asp: further processsing of data
    >
    >
    > This scenario works for a certain amount of data, but passing data in
    > Request.QueryString has its limits.
    > Is there any other way so that x3.asp can retrieve the data posted in
    > x1.asp? I could put the textual representation of Request.Form into a
    > session variable, but it would be much easier if I could pass on
    > Request.Form so that x3.asp would be able to access it the same way as it
    > could if x1.asp posted directly to x3.asp.
    >
    >
    >
    >
    >
    André Nobre, Nov 22, 2004
    #2
    1. Advertising

  3. Agoston Bejo

    Agoston Bejo Guest

    The main point is not having to know what exactly is in Request.Form AND not
    having to create forms for a simple redirect. (This latter could be
    generated based on Request.Form but then I would need a javascript that
    redirects a page etc. - too much work!)

    "André Nobre" <Andr > wrote in message
    news:...
    > You can use hidden fields to do this, redirecting from x2 to x3 with java
    > script.
    >
    > "Agoston Bejo" wrote:
    >
    > > Hi.
    > >
    > > x1.asp:
    > > <form method="post" action="x2.asp"> .... </form>
    > >
    > > x2.asp:
    > > DoSomeAdministration()
    > > Response.Redirect "x3.asp?" & Request.Form
    > >
    > > x3.asp: further processsing of data
    > >
    > >
    > > This scenario works for a certain amount of data, but passing data in
    > > Request.QueryString has its limits.
    > > Is there any other way so that x3.asp can retrieve the data posted in
    > > x1.asp? I could put the textual representation of Request.Form into a
    > > session variable, but it would be much easier if I could pass on
    > > Request.Form so that x3.asp would be able to access it the same way as

    it
    > > could if x1.asp posted directly to x3.asp.
    > >
    > >
    > >
    > >
    > >
    Agoston Bejo, Nov 22, 2004
    #3
  4. Agoston Bejo

    Jeff Cochran Guest

    On Mon, 22 Nov 2004 11:49:33 +0100, "Agoston Bejo" <>
    wrote:

    >Hi.
    >
    >x1.asp:
    ><form method="post" action="x2.asp"> .... </form>
    >
    >x2.asp:
    >DoSomeAdministration()
    >Response.Redirect "x3.asp?" & Request.Form
    >
    >x3.asp: further processsing of data
    >
    >
    >This scenario works for a certain amount of data, but passing data in
    >Request.QueryString has its limits.
    >Is there any other way so that x3.asp can retrieve the data posted in
    >x1.asp? I could put the textual representation of Request.Form into a
    >session variable, but it would be much easier if I could pass on
    >Request.Form so that x3.asp would be able to access it the same way as it
    >could if x1.asp posted directly to x3.asp.


    Or do your processing in x2.asp without needing to move to x3.asp. Or
    even post back to x1.asp, even displaying and repopulating the form if
    need be.

    Jeff
    Jeff Cochran, Nov 22, 2004
    #4
  5. Agoston Bejo wrote:
    > Hi.
    >
    > x1.asp:
    > <form method="post" action="x2.asp"> .... </form>
    >
    > x2.asp:
    > DoSomeAdministration()
    > Response.Redirect "x3.asp?" & Request.Form
    >
    > x3.asp: further processsing of data
    >
    > This scenario works for a certain amount of data, but passing data in
    > Request.QueryString has its limits.
    > Is there any other way so that x3.asp can retrieve the data posted in
    > x1.asp? I could put the textual representation of Request.Form into a
    > session variable, but it would be much easier if I could pass on
    > Request.Form so that x3.asp would be able to access it the same way as it
    > could if x1.asp posted directly to x3.asp.


    Server.Execute() may be what you want.
    Michael D. Kersey, Nov 22, 2004
    #5
  6. Agoston Bejo

    Agoston Bejo Guest

    Not exactly what I thought about, but works fine just the same.

    "Michael D. Kersey" <> wrote in message
    news:%...
    > Agoston Bejo wrote:
    > > Hi.
    > >
    > > x1.asp:
    > > <form method="post" action="x2.asp"> .... </form>
    > >
    > > x2.asp:
    > > DoSomeAdministration()
    > > Response.Redirect "x3.asp?" & Request.Form
    > >
    > > x3.asp: further processsing of data
    > >
    > > This scenario works for a certain amount of data, but passing data in
    > > Request.QueryString has its limits.
    > > Is there any other way so that x3.asp can retrieve the data posted in
    > > x1.asp? I could put the textual representation of Request.Form into a
    > > session variable, but it would be much easier if I could pass on
    > > Request.Form so that x3.asp would be able to access it the same way as

    it
    > > could if x1.asp posted directly to x3.asp.

    >
    > Server.Execute() may be what you want.
    Agoston Bejo, Nov 23, 2004
    #6
  7. Well, you could solve this in a pretty generic way, by iterating over
    the Request.Form collection, generating a form with corresponding
    hidden variables. And in the end, you include a Javascript that simply
    submits the form (rather than doing a redirect).

    Consider this simple function:

    ForwardForm "x3.asp"

    Sub ForwardForm(pstrURL)
    Dim strKey
    Response.Write("<form method=""post"" action=""" & pstrURL & """
    name=""forwardForm"">")
    For Each strKey In Request.Form
    Response.Write("<input type=""hidden"" name=""" & strKey & """
    value=""" & Request.Form(strKey) & """>")
    Next
    Response.Write("</form>")
    Response.Write("<script language=""javascript"">")
    Response.Write("if (document.forwardForm)
    document.forwardForm.submit();")
    Response.Write("</script>")
    End Sub

    Please note that you might need to escape certain characters (").

    Regards,
    Johan

    "Agoston Bejo" <> wrote in message news:<>...
    > The main point is not having to know what exactly is in Request.Form AND not
    > having to create forms for a simple redirect. (This latter could be
    > generated based on Request.Form but then I would need a javascript that
    > redirects a page etc. - too much work!)
    >
    > "André Nobre" <Andr > wrote in message
    > news:...
    > > You can use hidden fields to do this, redirecting from x2 to x3 with java
    > > script.
    > >
    > > "Agoston Bejo" wrote:
    > >
    > > > Hi.
    > > >
    > > > x1.asp:
    > > > <form method="post" action="x2.asp"> .... </form>
    > > >
    > > > x2.asp:
    > > > DoSomeAdministration()
    > > > Response.Redirect "x3.asp?" & Request.Form
    > > >
    > > > x3.asp: further processsing of data
    > > >
    > > >
    > > > This scenario works for a certain amount of data, but passing data in
    > > > Request.QueryString has its limits.
    > > > Is there any other way so that x3.asp can retrieve the data posted in
    > > > x1.asp? I could put the textual representation of Request.Form into a
    > > > session variable, but it would be much easier if I could pass on
    > > > Request.Form so that x3.asp would be able to access it the same way as

    > it
    > > > could if x1.asp posted directly to x3.asp.
    > > >
    > > >
    > > >
    > > >
    > > >
    Johan Ramestam, Nov 30, 2004
    #7
    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. Brian Henry

    forwarding a request from a specific ip

    Brian Henry, Mar 11, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    462
    Juan T. Llibre
    Mar 12, 2005
  2. Ashraf Fouad
    Replies:
    0
    Views:
    357
    Ashraf Fouad
    May 22, 2004
  3. Yogesh
    Replies:
    11
    Views:
    27,900
    Yogesh
    Jan 7, 2005
  4. Øyvind Isaksen
    Replies:
    1
    Views:
    965
    Øyvind Isaksen
    May 18, 2007
  5. Andrew Tomazos
    Replies:
    5
    Views:
    574
Loading...

Share This Page