Solved

Passing Multiple Variables with a Response.Redirect

Posted on 2006-07-21
3
287 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
3 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 400 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 100 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 65
topping2 challenge 13 59
Currency Conversion? 1 37
Recommendation vb6 to vb.net or others 14 33
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
This is an explanation of a simple data model to help parse a JSON feed
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 …

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now