Using Same Template In All ASP Pages
Using Same Template In All ASP Pages
am 23.05.2007 22:14:54 von rn5a
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
tags come, I will use the variable
strTitle
%>
<%= strTitle %>
<%
'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:
<%
Dim sBody
sBody=""
SetTemplate("Please Login",sBody)
%>
Is this the correct approach or can someone suggest me a better
workaround?
Thanks,
RON
Re: Using Same Template In All ASP Pages
am 24.05.2007 15:50:55 von Michael
I would recommend to cut your image into 4( at least parts) . Use Adobe for
example
Each part you can load as background for every page
for 4 parts it can be top part, left part and main part.
create
- top.asp
- left.asp
- main.asp
- footer.asp
make part of your image as background of whole page.
you default page will looks like
include top.asp
include left.asp
include main.asp
include footer.asp
any other page will include
include top.asp
include left.asp
' -----------------
page content
' -----------------
include footer.asp
wrote in message
news:1179951293.912344.226230@r19g2000prf.googlegroups.com.. .
> 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 tags come, I will use the variable
> strTitle
> %>
> <%= strTitle %>
> <%
> '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:
>
>
>
> <%
> Dim sBody
>
> sBody=""
>
> SetTemplate("Please Login",sBody)
> %>
>
> Is this the correct approach or can someone suggest me a better
> workaround?
>
> Thanks,
>
> RON
>
Re: Using Same Template In All ASP Pages
am 25.05.2007 10:09:52 von Adrienne Boswell
Gazing into my crystal ball I observed rn5a@rediffmail.com writing in
news:1179951293.912344.226230@r19g2000prf.googlegroups.com:
> 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)
>
Please don't use HTML tables for anything but tabular data. Tables are
not for positioning elements. Please use CSS and don't use
presentational markup.
<% option explicit
thispage = "" 'the page title goes in title and h1 element
thisurl = "" 'the actual url, needed for navigation
%>
<%
'linkrel includes DTD, HTML and Head elements, including the link to the
'stylesheet and favicon. I usually include a file called
'masterfunctions.asp and conn_inc.asp in this file as well.
'The usage of thispage above is like so:
'
<%=thispage%>
%>