?
Solved

Passing Multiple Variables with a Response.Redirect

Posted on 2006-07-21
3
Medium Priority
?
336 Views
Last Modified: 2010-04-17
Hello,

I've been searching how to pass multiple variables with a response.redirect for a little to long now and need some help.

I've tried this method
http://www.experts-exchange.com/Programming/Q_21248972.html?query=passing+multiple+variables+with+response.redirect&clearTAFilter=true

First let me start by explaining my madness

i have a form that "posts" the info to a page that checks against the dB for if it exists, then to either displaying the dB records or a page that informs the user the records exists and a button back to the form. On that page I want to be able to write the variables i'm passing, however i do a response.write on the query string of DateID and it will display that one but only that one if the "&" are next to the field name in the redirect as below

Response.redirect "add_projres_no.asp?DateID=" & ResDay & "&TimeID=" & ResTime & "&RoomID=" & ResRoom
output of request.querystring = 81

If i remove the "&" and the redirect is as below
Response.redirect "add_projres_no.asp?DateID=" & ResDay & "TimeID=" & ResTime & "RoomID=" & ResRoom
output of request.querystring = 81TimeID=16RoomID=12
0
Comment
Question by:thosrmann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 1200 total points
ID: 17157472
thosrmann,

I am not positive I understand your question but Request.Querystring will only provide the variable you specify after that command.  For example in the querystring you had in the first code you would need to use the following line to get all of the variables in the string.

Request.Querystring("DateID")
Request.Querystring("TimeID")
Request.Querystring("RoomID")

One request would not work.  As you found in the second example if you leave out the ampersand (& sign) in the string then all of the information is treated as the value of DateID.  The ampersand is used to separate name/value pairs in the string.  For example,

?name1=value1&name2=value2&name3=value3

Let me know if you have any questions.  I think your problem will be solved by making the additional requests for the other "variables" in the string.  If you need more information or I misunderstood the problem just let me know how I can help.

b0lsc0tt
0
 
LVL 14

Assisted Solution

by:shahprabal
shahprabal earned 300 total points
ID: 17161950
You can also you a session variable to pass the value to the second page.
0
 
LVL 1

Author Comment

by:thosrmann
ID: 17168903
They both kinda answered by question, so thanks to both ill divide accordingly

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question