valkr1e
Posts: 12
|
| Posted: 11/01/2004, 9:02 AM |
|
I'm writing an app where i will have multiple websites accessing a single database, but each site will have independent content, thusly, i need to filter all of my grids with some type of session or other variable that will be set once the user loads ANY page that is in the site(each site will have a separate set of files, so the definition can be hard coded). the most apparent solution is to declate a session variable in an include page, such as common.asp or a custom include page, but i'm extremely new to asp(havent coded anything in many years, my last couple apps were all fortran) and am unsure whether my syntax thinking is alright or not. i was thinking of creating a simple include file called IncSiteID.asp with the following code:
<% Session("SiteID") = 1 %>
where the site ID is a PK in a sql table, that all the tables reference to differentiate between sites. if my understanding is correct, i could even feasibly add this line to common.asp or whetever, and it would be set, is my thinking correct on this?
|
 |
 |
mrachow
Posts: 509
|
| Posted: 11/02/2004, 12:50 AM |
|
At any point of time on any page you can assign a value to a session variable (like you did) and/or retrieve its value.
If the session variable doesn't exist it is created with the first assignment.
There is no need to declare it anywhere.
Regards,
Michael
_________________
Best regards,
Michael |
 |
 |
|