Passing values through redirect page

  • Thread starter Thread starter L Scal
  • Start date Start date
L

L Scal

Tom and all,
I thought I had this but I don't. I've used the recommended:
<%
If request.form("field") = "Yes" Then
Response.Redirect "page1.asp"
Else
Response.Redirect "page2.asp"
End If
%>
I put the above on a hidden page above the HTML tag. On the hidden page I
created a form with hidden fields action=POST in an effort to pass the
values from the previous submitting form to the redirect page, where there
are also hidden fields. The pages redirect as expected, but the values do
not follow.
Can you help?
Thanks
LScal
 
LScal

That is normal. What I do at this point is to store the value in sessions, then retrieve them as
needed on additional pages.

<%
Session("fieldname") = Request.Form("fieldname")
%>

The when I need to use the value stored in the session, I retrieve them as:

Session("fieldname")

or to display

<%=Session("fieldname")%>


You might find that the easiest solution would be to use Server.Execute, which will retain and pass
on the values. I have not used Server.Execute yet, but this is what I understand to be one of the
major benefits.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Hi L Scal,

You'll have to use the server.execute to have the values follow or include them on the redirect statement

response.redirect "page1.asp?field1=" & request("Field1") & "field2=" & request("Field2") & ....

or you can store them in a dictionary session for use in subsequent pages.

An last but not least you can use the XML engine to post to the next page
 
Back
Top