Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list question

Status
Not open for further replies.

Leakyradiator

Technical User
Jul 12, 2002
35
0
0
US
If I create a list on template A, is it available on template B? If not, how do I pass a list between templates?

Thanks
 
depends

how are you invoking template B from template A?

if it's cfinclude, no problemo

if it's cflocation, it's a bit harder

(i've always been very leery of cflocation, i've always figured a cf developer who relies on cflocation a lot just hasn't figured out how to use cfincludes)

session variable will do the trick

url string might also work (if the list isn't too long)

saving the list to a database table is also feasible



rudy | r937.com | Ask the Expert | Premium SQL Articles
SQL for Database-Driven Web Sites (course starts January 9 2005)
 
I wasn't invoking template A in template B. But I want to use the list across multiple templates. Can this be done in the session scope? Or is there a better way to pass lists between templates?

Thanks
 
shoot... one of my biggest apps puts a list in a session variable. a list is nothing more than a string with a common seperator.

<cfset session.myListOfFriends = "Bob,Jim,Joe,Steve,Alex,Roger,Tracy,Mike,Jackie,Pete,Mary-Jane,Susan">

nothin' to it

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top