Passing variables using response.redirect

Results 1 to 2 of 2

Thread: Passing variables using response.redirect

  1. #1
    Join Date
    Dec 1969

    Default Passing variables using response.redirect

    I have a form that when filled and submit is pushed the user unknowingly is taken to an asp page that query&#039;s my database on the information they have entered. If the information has a match in the database then they are redirected to a form that is pretty detailed that fills in about 60 different entries from text fields to checkboxes to radio buttons, if the information does not match then they are redirected to the form with an alert.<BR><BR>My problem is here:<BR><BR>Response.Redirect "profileupdate.asp? &#060;&#060;&#060;&#060;What goes here&#062;&#062;&#062;&#062;&#062;<BR><BR>The two field names are "address" and "name". I need to use request.form for both and cannot get the two variables to pass in the url. I can type them out for example:<BR><BR>Response.Redirect "profileupdate.asp?FirstName=justin&Email=justin@a"<BR><BR>But I am using request.form b/c the query is dependent upon the form entry so this simple solution will not apply.<BR><BR>My question is what is the syntax that follows the question mark?<BR><BR>FYI: I can get one field to work and it looks like this: <BR><BR>Response.Redirect "profileupdate.asp?FirstName="&Request.Form("name" )<BR><BR>Please Help!

  2. #2
    Join Date
    Dec 1969

    Default RE: Passing variables using response.redirect

    It appears you&#039;re a bit lost. When you pass variables through the querystring with response.redirect you need to retrieve them on the next page using request.querystring("whatever"). You&#039;ve demonstrated the syntax needed for writing the response.redirect. It&#039;s response.redirect "whatever.asp?var1=something&var2=somethingelse&va r3=etc..." If you are trying o build it using request.form then you would do:<BR><BR>"profileUpdate.asp?firstName=" & request.form("name") & "&email=" & server.urlEncode(request.form("email")<BR><BR>You can *not* retrieve values passed from a response.redirect with request.form Your only option if you *absolutely* have to pass via "POST" would be to redirect to a page that has javascript that onLoad will get the data from the querystring and automatically submit a form by "POST"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts