Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Calling ASP variable to another ASP file

Reply
Thread Tools

Calling ASP variable to another ASP file

 
 
Avi
Guest
Posts: n/a
 
      11-02-2005
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

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      11-02-2005
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)

 
Reply With Quote
 
 
 
 
Avi
Guest
Posts: n/a
 
      11-02-2005
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

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      11-02-2005
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)

 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      11-04-2005
"Avi" wrote in message
news: 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


 
Reply With Quote
 
Avi
Guest
Posts: n/a
 
      11-04-2005

Roland Hall wrote:
> "Avi" wrote in message
> news: 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.

 
Reply With Quote
 
Avi
Guest
Posts: n/a
 
      11-04-2005
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.

 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      11-05-2005
"Avi" wrote in message
news: 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a variable inside a function of another class Yigit Turgut Python 5 01-10-2012 10:41 PM
Calling a function that expects variable arguments from a functionwith variable arguments Navaneeth C Programming 4 11-20-2010 05:35 AM
"Variable variable name" or "variable lvalue" mfglinux Python 11 09-12-2007 03:08 AM
Function pointers, variable argument functions calling other variable-argument functions (sort of) S?ren Gammelmark C Programming 1 01-07-2005 09:41 PM
How do I scope a variable if the variable name contains a variable? David Filmer Perl Misc 19 05-21-2004 03:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57