Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 11th, 2007, 11:58 AM
Registered User
 
Join Date: Oct 2006
Location: phoenix, as, .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default using variables

Hi, Please excuse my newish question but I am having difficulties trying to find the answer. I would like to update a current site in which I use figures on multiple pages, like total gross income. I would like to use a variable that can be referenced on multiple pages but requires updating only one file. I appreciate any assistance!!!

Reply With Quote
  #2 (permalink)  
Old April 11th, 2007, 12:11 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You can use a session variable.

To set the value use:
Session("GrossIncome") = "someValue"

To read the value:
Dim sGross
sGross = CStr(Session("GrossIncome"))

hth


================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #3 (permalink)  
Old April 11th, 2007, 01:01 PM
Registered User
 
Join Date: Oct 2006
Location: phoenix, as, .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for the response, however the same data needs to be on separate web pages, for instance total gross income is shown on 5 different pages and occasionally in different directories within the website. I am looking for something that would work similar to an include in which the total gross income is listed once, but referenced 5 times.

Reply With Quote
  #4 (permalink)  
Old April 11th, 2007, 06:46 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default


You say:
;;;the same data needs to be on separate web pages
The solution given in this post will meet your needs providing you mean seperate web pages within the same site/session, do you?

If you would like this value to be used amoung different web sites or sessions, I would use a database

You also say:
;;I am looking for something that would work similar to an include in which the total gross income is listed once

Remember an include is just part of a page. A dynamic value populated from a session variable or a database would be my suggestion. Sure, place this in an include however it doesnt matter really

Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
variables daniel.mihalcea Javascript 1 September 9th, 2008 07:06 PM
Global Variables in C# su C# 2 December 11th, 2006 06:18 PM
Passing Variables silve1999 Pro Java 1 June 15th, 2006 12:54 PM
undifined variables bogins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 April 19th, 2004 06:19 PM



All times are GMT -4. The time now is 06:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.