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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Initialize Variables

Status
Not open for further replies.

john33

Programmer
Sep 25, 2000
5
0
0
US
I'm new to ASP and am using it in linking my webpage to a backend database.

If I choose not to use a global.asa to define my session and application variables, where else could I store them.

I was playing around with doing it in my code but would prefer to keep them together.

Your help is appreciated.
 
John,

What I like to do is set up a template system.

1-User connects to web page on Default.asp
2-Default.asp includes (<!--#include virtual=&quot;site/includes/sitevars.asp&quot;-->) a sitevars.asp file that contains code for DB access strings, site constants, color codes, etc.
3-Default.asp includes template.html
4-The template file looks like this...
Code:
<!--***-Begin PageSetup------Self contained - Contains document headers and all style settings--------------------***-->
<!--#Include Virtual=&quot;Site/Includes/SiteTemplates/template_pagesetup.html&quot;-->
<!--***-End PageSetup---------------------------------------------------------------------------------------------***-->

<!--***-Begin TitleBar------Self contained - title bar-------------------------------------------------***-->
<!--#Include Virtual=&quot;Site/Includes/SiteTemplates/template_titlebar.html&quot;-->
<!--***-End TitleBar-----------------------------------------------------------------------------------------***-->

<!--***-Begin MenuBar------Self contained - Site Menu bar----------------------------------------------------------***-->
<!--#Include Virtual=&quot;Site/Includes/SiteTemplates/template_menubar.html&quot;-->
<!--***-End MenuBar-----------------------------------------------------------------------------------------------***-->

<!--***-Begin HeaderBar------Self contained - Site Header (title and logo)-----------------------------------------***-->
<!--#Include Virtual=&quot;Site/Includes/SiteTemplates/template_headerbar.html&quot;-->
<!--***-End HeaderBar---------------------------------------------------------------------------------------------***-->

<!--***-Begin ContentBarTop------Front table tags for content area - Needs contentbarbottom for ending table tags-***-->
<!--#Include Virtual=&quot;Site/Includes/SiteTemplates/template_contentbartop.html&quot;-->
<!--***-End ContentBarTop-----------------------------------------------------------------------------------------***-->

<!--***-Begin Content------Self contained - Unique content for page-----------------------------------------------***-->
<!--#Include File=&quot;content.html&quot;-->
<!--***-End Content-----------------------------------------------------------------------------------------------***-->

<!--***-Begin ContentBarBottom------Ending table tags for contentbartop-------------------------------------------***-->
<!--#Include Virtual=&quot;Site/Includes/SiteTemplates/template_contentbarbottom.html&quot;-->
<!--***-End ContentBarBottom--------------------------------------------------------------------------------------***-->

<!--***-Begin Footer------Self contained - property notice---------------------------------------------------***-->
<!--#Include Virtual=&quot;Site/Includes/SiteTemplates/Footer.html&quot;-->
<!--***-End Footer----------------------------------------------------------------------------------------------***-->

4-Each of the individual .html files is positioned with DIV tags.

So every folder needs default.asp, template.html and content.html. A single includes folder contains all the pieces necessary to build the page. This allows for code-reuse and ease of maintenance.

If you need more detail just ask, [sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top