With a project to help reuse code there are often things that you'd like to have set in one place. Thus if you ever need to change something like the title of the site or the version date it could be changed in only one page instead of having to make the change on every page of the site.
To do this perhaps create a file (called something like config.asp) to be included in each page. It could contain things like this:
<%
mstrSiteTitle = "Bullschmidt.com"
mstrColorMain = "#FFFFFF"
mintSessionTimeoutMin = 60
mvarVersionDt = DateSerial(2003, 1, 1)
%>
And the following line would be located toward the top of most Web pages to include the config.asp file:
<!--#include file="config.asp"-->
And then on your Web pages you could use things from the config.asp file like this:
<% Session.Timeout = mintSessionTimeoutMin %>
<title><%= mstrSiteTitle %> - ASP Web Developer Tips</title>
<body bgcolor="<%= mstrColorMain %>">
Design updated <%= FormatDateTime(mvarVersionDt, vbShortDate) %>
And the outputed HTML code would look like this:
<title>Bullschmidt.com - ASP Web Developer Tips</title>
<body bgcolor="#FFFFFF">
Design updated 1/1/2003
And the session timeout would be set at 60 minutes instead of whatever the server's default was set to. And by the way if your site has an initial login page, you might just set the session timeout once on that page.
Best regards,
J. Paul Schmidt
www.Bullschmidt.com - Freelance ASP Web Developer
www.Bullschmidt.com/DevTip.asp - ASP Web Developer Tips
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.