I am working in a classic ASP project where the flow was like this:
a ----> b ------> c
and another flow was like this:
a ------> d -------> c
but now, due to a change in requirements, the flow needs to be like this:
a -----> b -----> d ------> c
The form data which was previously posted to page d
now needs to be posted to page b
. Is there any way to post this data again from b
to d
?
I have kept those values in a session in b.asp
but, in that case, I have to change the existing design in page d
since request.form()
is used to read those.
Is there any better way to do this without changing the design in page d
? Can the form variables posted in b
be again posted in d
?
In page B, create a <form>
and write the session values to <hidden>
form elements. I'm not sure how your b.asp
page functions, but you can write the form on the initial page load or a post-back and have it submit automatically or you could have a client action submit the form.
For example, to create a page that just forwards the POST to d.asp
:
Response.Clear
Response.Write "<html>"
Response.Write "<body onload='document.forms[""form""].submit()'>"
Response.Write "<form name='form' action='d.asp' method='post'>"
' For each Session variable...
Response.Write "<input type='hidden' name='SomeVar' value='" & Session("SomeVar") & "'>"
' Or, for each Form variable...
Response.Write "<input type='hidden' name='SomeVar' value='" & Request.Form("SomeVar") & "'>"
Response.Write "</form></body></html>"
Response.End