473,508 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I simply pass a simple variable??

I am simply trying to pass a variable to another page. I know my second
page can do Request("str") to retrieve that variable, but how do I pass it
in the first place?

I tried Server.Execute("P2.asp?str="hello") but I get errors.
I tried Response.Redirect("P2.asp?str="hello") but the variable is empty

I tried setting variables like you would in VB:
str="hello"
Server.Execute("P2.asp")
and hoping the second page would pick it up, but I don't know how to make
that str variable global.

I am not using forms, I am not using cookies, I was told not to use Session
or Application variables, it's a variable being passed just the first time a
page is accessed, after that links will send the variables.

How do you Set str="something" and then have the 2nd page pick it up?????
It shouldn't be that difficult!
Jul 19 '05 #1
5 2321
eagletender wrote on 10 jul 2004 in
microsoft.public.inetserver.asp.general:
I know my second
page can do Request("str")
myStrP2 = Request.Querystring("str")
I tried Response.Redirect("P2.asp?str="hello") but the variable is empty


[if we are using vbscript:]

Response.Redirect "P2.asp?str=hello"

or

myStrP1 = "hello"
Response.Redirect "P2.asp?str=" & myStrP1

================

I would prefer a session variable to get this pure serverside content from
one page to another.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
Response.redirect "?err=something_else"

<%
something = request.querystring("err")
response.write something
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"eagletender" <ea*************@yahoo.com> wrote in message
news:10*************@corp.supernews.com...
I am simply trying to pass a variable to another page. I know my second
page can do Request("str") to retrieve that variable, but how do I pass it
in the first place?

I tried Server.Execute("P2.asp?str="hello") but I get errors.
I tried Response.Redirect("P2.asp?str="hello") but the variable is empty

I tried setting variables like you would in VB:
str="hello"
Server.Execute("P2.asp")
and hoping the second page would pick it up, but I don't know how to make
that str variable global.

I am not using forms, I am not using cookies, I was told not to use Session or Application variables, it's a variable being passed just the first time a page is accessed, after that links will send the variables.

How do you Set str="something" and then have the 2nd page pick it up?????
It shouldn't be that difficult!

Jul 19 '05 #3
On Sat, 10 Jul 2004 11:02:34 -0600, "eagletender"
<ea*************@yahoo.com> wrote:
I am simply trying to pass a variable to another page. I know my second
page can do Request("str") to retrieve that variable, but how do I pass it
in the first place?

I tried Server.Execute("P2.asp?str="hello") but I get errors.
Yep. See:

http://www.aspfaq.com/show.asp?id=2030
I tried Response.Redirect("P2.asp?str="hello") but the variable is empty
Yep.
I tried setting variables like you would in VB:
str="hello"
Server.Execute("P2.asp")
and hoping the second page would pick it up, but I don't know how to make
that str variable global.
Can't.
I am not using forms, I am not using cookies, I was told not to use Session
or Application variables, it's a variable being passed just the first time a
page is accessed, after that links will send the variables.
Forms, sessions and cookies would all do what you wish.
How do you Set str="something" and then have the 2nd page pick it up?????
It shouldn't be that difficult!


Request.Querystring:

http://www.devguru.com/Technologies/...erystring.html

Jeff
Jul 19 '05 #4
Have you tried using a session variable?

Jeff Cochran wrote:
On Sat, 10 Jul 2004 11:02:34 -0600, "eagletender"
<ea*************@yahoo.com> wrote:

I am simply trying to pass a variable to another page. I know my second
page can do Request("str") to retrieve that variable, but how do I pass it
in the first place?

I tried Server.Execute("P2.asp?str="hello") but I get errors.

Yep. See:

http://www.aspfaq.com/show.asp?id=2030

I tried Response.Redirect("P2.asp?str="hello") but the variable is empty

Yep.

I tried setting variables like you would in VB:
str="hello"
Server.Execute("P2.asp")
and hoping the second page would pick it up, but I don't know how to make
that str variable global.

Can't.

I am not using forms, I am not using cookies, I was told not to use Session
or Application variables, it's a variable being passed just the first time a
page is accessed, after that links will send the variables.

Forms, sessions and cookies would all do what you wish.

How do you Set str="something" and then have the 2nd page pick it up?????
It shouldn't be that difficult!

Request.Querystring:

http://www.devguru.com/Technologies/...erystring.html

Jeff


Jul 19 '05 #5
Buddy you are using quoted identifiers in the wrong way

Try this

1.
Server.Execute("P2.asp?str='hello'")
Response.Redirect("P2.asp?str='hello'")

2.
Server.Execute("P2.asp?str=hello&Variable2=whateve r you want goes here")
Response.Redirect("P2.asp?str=The string here can contain spaces")

And to access any of the vairables just do this

x = Request.QueryString("str")
Response.Write(x) ' do anything withthe variable
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2048
by: Doug Jordan | last post by:
I am fairly new to Python. This should be an easy answer but I cannot get this to work. The code is listed below. I know how to do this in C, Fortran, and VB but it doesn't seem to work the same...
12
2912
by: Phil Certain | last post by:
Hi, I'm trying to do something very simple...or at least it should be. I have created a host page (gen.aspx) and a very simple user control (us.ascx). The corresponding code-behind files are...
4
2219
by: Phillip Vong | last post by:
I'm a newbie using VS2005 to learn and test. I'm testing against the Northwind DB. I created a simple variable called "myVariable" and I assigned it the character "c". I want my SQL query to use...
3
2022
by: jonnyblazed | last post by:
I've searched everywhere for this but I'm not sure exactly what to search for. What I am trying to do is pass a variable to a php script via the URL. However, I don't want to use the standard...
10
1537
by: tshad | last post by:
I want to access multiple arguments based on name passed. For example I have the following asp:textboxes: BillingAddress1 BillingAddress2 BillingCity ShippingAddress1 ShippingAddress2...
5
5735
by: techbuddha | last post by:
Hi new to the forum and visual basic. I am attempting to fix a migration of excel to access. The excel sheets where simple copied as is into access. for example one table lists the academic...
6
2698
by: lisp9000 | last post by:
I've read that C allows two ways to pass information between functions: o Pass by Value o Pass by Reference I was talking to some C programmers and they told me there is no such thing as...
12
2996
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope....
12
11007
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
7233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7135
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5060
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.