Please have a look at the image at the URL given below:
http://rn5a.brinkster.net/Template.gif
I would like to use that image as a template for all the ASP pages in
a website. Note that though it looks like a frames page, it's actually
not a frames page. Using different images has made it look like a
frames page.
The "Your Site Name" header, the 5 links "Home", "About", "Forums",
"Downloads" & "Support" links & the different links on the left hand
side will be available in all the pages. In other words, the actual
contents of the different pages would be displayed where there's "TEXT
COMES HERE".
I am not very sure on how to go about it. Can someone please give some
idea?
What I was thinking of doing is encapsulating the entire template in
an INCLUDE file, say, Template.inc & then adding the following code in
Template.inc (note that the template not only uses images but also
HTML tables)
<%
Sub SetTemplate(strTitle,strBody)
'here comes the upper part of the template
'wherever the <titletags come, I will use the variable
strTitle
%>
<title><%= strTitle %></title>
<%
'here comes the left hand side of the template
'finally here comes the contents of the files that will use
this template
strBody
%>
For e.g. when the "Forums" link is clicked, users are first told to
login using their username & password. Assume that the page where
users login is named Login.asp. This will be the code in Login.asp:
<!-- #include file="Template.inc" -->
<%
Dim sBody
sBody="<form method=post action='CheckLogin.asp' onSubmit='return
check()'>" & vbCrLf
sBody=sBody & "<input type=text name='username'><br>" & vbCrLf
sBody=sBody & "<input type=password name='password'><br><br>" &
vbCrLf
sBody=sBody & "<input type=submit value='LOGIN'>" & vbCrLf
sBody=sBody & "</form>"
SetTemplate("Please Login",sBody)
%>
Is this the correct approach or can someone suggest me a better
workaround?
Thanks,
RON