473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Calling ASP variable to another ASP file

Avi
I have two asp files. I would like to call a variable from one of the
asp files to another one.

first.asp file activated it has the following variables that I want
called by other files.
demoName="Test demo"
salesPersonEmail="first.last"
specificURL="testURL"

The other asp file should be able to call on this information, and then
place it in various areas.

Thanks,

Avi

Nov 2 '05 #1
7 2560
Avi wrote on 02 nov 2005 in microsoft.public.inetserver.asp.general:
I have two asp files. I would like to call a variable from one of the
asp files to another one.

first.asp file activated it has the following variables that I want
called by other files.
demoName="Test demo"
salesPersonEmail="first.last"
specificURL="testURL"

The other asp file should be able to call on this information, and then
place it in various areas.


Use session variables

<%
session("demoName")="Test demo"
%>

and in the next page:

<%
demoName = session("demoName")
%>

demoName is: <%=demoName %>
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 2 '05 #2
Avi
Hello.
Thanks for the help, but this did not work for me. Maybe I need to
explain more.

I have an asp file (begin.asp). I want to put something similar to the
following in it:
demoName="Test demo"
salesPersonEmail="first.last"
specificURL="testURL"

The form will then redirect the user to one of two pages (if it is a
first time user then it goes to one page, if it is a returning user it
goes to a different page). This is handled by a cookie.
I want the pages the user gets sent to to retreive the above
information so it could be utilized.

Thanks,

Avi

Nov 2 '05 #3
Avi wrote on 02 nov 2005 in microsoft.public.inetserver.asp.general:
Thanks for the help, but this did not work for me. Maybe I need to
explain more.
If you do not quote onn usenet, others cannot follow you, so please quote
where you are responding on.

Start by telling what you mean by "did not work for me"

I have an asp file (begin.asp). I want to put something similar to the
following in it:
demoName="Test demo"
salesPersonEmail="first.last"
specificURL="testURL"

The form will then redirect the user to one of two pages (if it is a
first time user then it goes to one page, if it is a returning user it
goes to a different page). This is handled by a cookie.
I want the pages the user gets sent to to retreive the above
information so it could be utilized.


I seem vaguely to remember I advised session variables.
Why wouldn't they "work"?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 2 '05 #4
"Avi" wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
: Hello.
: Thanks for the help, but this did not work for me. Maybe I need to
: explain more.

No offense but you need to listen more. Evertjan is telling you how to
store the value of a variable and easily retrieve it on another page. If
you're not familiar with session variables, then say so. It makes it easier
to help you. "did not work for me" tells us nothing specific. We depend on
you to draw us a picture and all we're seeing is you have a blank page.

: I have an asp file (begin.asp). I want to put something similar to the
: following in it:
: demoName="Test demo"
: salesPersonEmail="first.last"
: specificURL="testURL"

session("demoName") = "Test demo"
session("salesPersonEmail") = "first.last"
session("specificURL") = "testURL"

: The form will then redirect the user to one of two pages (if it is a
: first time user then it goes to one page, if it is a returning user it
: goes to a different page). This is handled by a cookie.
: I want the pages the user gets sent to to retreive the above
: information so it could be utilized.

page1.asp/page2.asp

..
..
..
dim demoName, salesPersonEmail, specificURL
demoName = session("demoName")
salesPersonEmail = session("salesPersonEmail")
specificURL = session("specificURL")
..
..
..
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Nov 4 '05 #5
Avi

Roland Hall wrote:
"Avi" wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
: Hello.
: Thanks for the help, but this did not work for me. Maybe I need to
: explain more.

No offense but you need to listen more. Evertjan is telling you how to
store the value of a variable and easily retrieve it on another page. If
you're not familiar with session variables, then say so. It makes it easier
to help you. "did not work for me" tells us nothing specific. We depend on
you to draw us a picture and all we're seeing is you have a blank page.

: I have an asp file (begin.asp). I want to put something similar to the
: following in it:
: demoName="Test demo"
: salesPersonEmail="first.last"
: specificURL="testURL"

session("demoName") = "Test demo"
session("salesPersonEmail") = "first.last"
session("specificURL") = "testURL"

: The form will then redirect the user to one of two pages (if it is a
: first time user then it goes to one page, if it is a returning user it
: goes to a different page). This is handled by a cookie.
: I want the pages the user gets sent to to retreive the above
: information so it could be utilized.

page1.asp/page2.asp

.
.
.
dim demoName, salesPersonEmail, specificURL
demoName = session("demoName")
salesPersonEmail = session("salesPersonEmail")
specificURL = session("specificURL")
.
.
.
--
Roland Hall


In the begin.asp page i pasted this:
session("demoName") = "AviTest"
session("salesPersonEmail") = "avi.lazar"
session("specificURL") = "http://isn'tThisCool"

In the page that begin.asp redirects to I pasted this:

dim demoName, salesPersonEmail, specificURL
demoName = session("demoName")
salesPersonEmail = session("salesPersonEmail")
specificURL = session("specificURL")

I did not get any errors, but the information was not sent to me in an
e-mail.

Normally, I declare the variables at the top of the second page and
these variables are inserted into an e-mail whenever the page is
accessed. The e-mail is sent to a specific person.

With the code, the pages are accessed, the e-mail is sent but there is
no data where normally there is.

Nov 4 '05 #6
Avi
Hey guys.

It is working now. When I copy and pasted the code an extra space was
inserted at the end of each code line. Prior to deleting this space it
wasn't working, after deleting it, it was working.

Thanks for all of your help.

Nov 4 '05 #7
"Avi" wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
: It is working now. When I copy and pasted the code an extra space was
: inserted at the end of each code line. Prior to deleting this space it
: wasn't working, after deleting it, it was working.

If it's user input, it's generally a good idea to trim the spaces off.
ltrim, rtrim or trim (left, right, both)

: Thanks for all of your help.

Glad you got it working. Thanks for the update.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Nov 5 '05 #8

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

Similar topics

5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
2
by: mark | last post by:
How does one call a variable defined in a class defined in file1.cpp from another file file2.cpp. Or can one call a class from a different file ? (Besides the standard way to define the variable...
8
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int...
10
by: headware | last post by:
I know that you can call the method of one from from inside another form by doing something like this Forms("MyForm").MyFunction(12, 34) However, you have to know that MyForm has a function...
30
by: Tim Marshall | last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post: A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several...
19
by: Ross A. Finlayson | last post by:
Hi, I hope you can help me understand the varargs facility. Say I am programming in ISO C including stdarg.h and I declare a function as so: void log_printf(const char* logfilename, const...
13
by: santosh | last post by:
Hi, If I call free() with a uninitialised pointer, will the program state become undefined, or will free() return harmlessly? Incidentally, is there a way in Standard C to determine weather a...
8
by: Jeff | last post by:
Still new to vb.net in VS2005 web developer... What is the proper/standard way of doing the following - setting the value of a variable in one sub and calling it from another? E.g., as below....
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.