Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2007, 11:58 AM
Registered User
 
Join Date: Oct 2006
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!!!

 
Old April 11th, 2007, 12:11 PM
Wrox Author
 
Join Date: Oct 2005
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
================================================== =========
 
Old April 11th, 2007, 01:01 PM
Registered User
 
Join Date: Oct 2006
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.

 
Old April 11th, 2007, 06:46 PM
Friend of Wrox
 
Join Date: Jan 2004
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





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





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