C and S Design.
Search Friendly Programming and Design

Go to -> C and S Design -> Articles -> Code -> ASP



Code Articles

Coding for Simplicity

The easiest way of programming is to write functions and routines into modules. Anyone one who has coded in the more structured languages will work this way without conciously thinking about it. Website script coding and development is no different. Think about it, if you have some functions related to navigation, then have an include file for navigation functions, SQL in a SQL module, text handling in a text functions module. To include all these different include modules into the pages all it needs is to have one include file that is simply a list of includes.
for example this;

<!--#include virtual="/include/inc_file_list.asp"-->
will include all of the files in the include directive list. It is important to note that using includes in this way every directive in the list must use the "virtual" argument so the directive can be called from any file anywhere in the site structure.
More details on ASP Includes

Get this Code: Click to download the ASP file.
Do not copy and paste the displayed code. The display function adds line breaks so what you see is definitely not what you would get.

Code for this Example. (Include List)

<%
option explicit
'list of included files
%>
<!--#include _ 
	virtual="/include/inc_gen_vars.asp"-->
<!--#include _ 
	virtual="/include/inc_config_vars.asp"-->
<!--#include _ 
	virtual="/include/inc_markup_vars.asp"-->
<!--#include _ 
	virtual="/include/common/inc_ado_vars.asp"-->
<!--#include _ 
	virtual="/include/common/inc_db_vars_.asp"-->

<!--#include _ 
	virtual="/include/common/inc_track_funcs.asp"-->
<!--#include _ 
	virtual="/include/common/inc_sql_funcs.asp"-->
<!--#include _ 
	virtual="/include/common/inc_text_funcs.asp"-->
<!--#include _ 
	virtual="/include/inc_nav_funcs.asp"-->
<!--#include _ 
	virtual="/include/inc_sql_funcs.asp"-->
<!--#include _ 
	virtual="/include/common/inc_file_funcs.asp"-->
<!--#include _ 
	virtual="/include/common/inc_math_funcs.asp"-->


Functions and Sub-routines

Available from this site will be a library of ASP Functions and Subroutines that have been developed and used to build various web applications. Some are pretty simple, comprising of 3 or 4 lines of code to get the name of the page being viewed so that the CSS class can be changed to indicate the active page or to expand or collapse the navigation menu as you see to the left of the page.


Valid HTML 4.01! Valid CSS! copyright © C and S Design 2004 - 2005
Website Design and SE Friendly Coding C and S Design