473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Server-Side Includes and ASP

I have a segment of HTML code that I want to put in a server-side include.
All but one line of this code will be constant in all file it is included
in. However, there are many places in the HTML that include double quotes.
From what I can conclude, this leaves me with the following options:

1. Make several files to include, 1 for the constant HTML before the
non-constant HTML, 1 for the line of code that is not constant, and 1 for
the constant HTML after the non-constant HTML.

2. Convert the constant html into strings that are created using Chr()
function for all the double quotes and written using Response.Write().

Option 1 requires less effort, but would require more files to keep track of
and would require me to pull 3 files in rather than just 1. Option 2 allows
me to do everything with one file, but would be harder to edit because the
code will no longer look like HTML. Any suggestions? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Jul 22 '05 #1
3 1089
Nathan Sokalski wrote:
I have a segment of HTML code that I want to put in a server-side include.
All but one line of this code will be constant in all file it is included
in. However, there are many places in the HTML that include double quotes.
From what I can conclude, this leaves me with the following options:

1. Make several files to include, 1 for the constant HTML before the
non-constant HTML, 1 for the line of code that is not constant, and 1 for
the constant HTML after the non-constant HTML.

2. Convert the constant html into strings that are created using Chr()
function for all the double quotes and written using Response.Write().

Option 1 requires less effort, but would require more files to keep track of
and would require me to pull 3 files in rather than just 1. Option 2 allows
me to do everything with one file, but would be harder to edit because the
code will no longer look like HTML. Any suggestions? Thanks.


Hello,

Option 3 : Why not put a variable in your main template, then affecting
it before including the file.
Here is an example :

template.asp :
<HTML><BODY>
Page Header
<%=MyVar%>
Page Footer
</BODY></HTML>
------------------

And your main page could be :
<%
Dim MyVar
MyVar = "Some text"
%>
<!-- #include file="template.asp" -->
------------------

Regards,
JP.
Jul 22 '05 #2
I don't think that solves my problem, because I still have to make
everything into a string (in your example MyVar), which presents the same
problem I mentioned in solution #2.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Jean-Pierre Thomasset" <th*************@free.fr> wrote in message
news:42*********************@news.free.fr...
Nathan Sokalski wrote:
I have a segment of HTML code that I want to put in a server-side
include. All but one line of this code will be constant in all file it is
included in. However, there are many places in the HTML that include
double quotes. From what I can conclude, this leaves me with the
following options:

1. Make several files to include, 1 for the constant HTML before the
non-constant HTML, 1 for the line of code that is not constant, and 1 for
the constant HTML after the non-constant HTML.

2. Convert the constant html into strings that are created using Chr()
function for all the double quotes and written using Response.Write().

Option 1 requires less effort, but would require more files to keep track
of and would require me to pull 3 files in rather than just 1. Option 2
allows me to do everything with one file, but would be harder to edit
because the code will no longer look like HTML. Any suggestions? Thanks.


Hello,

Option 3 : Why not put a variable in your main template, then affecting it
before including the file.
Here is an example :

template.asp :
<HTML><BODY>
Page Header
<%=MyVar%>
Page Footer
</BODY></HTML>
------------------

And your main page could be :
<%
Dim MyVar
MyVar = "Some text"
%>
<!-- #include file="template.asp" -->
------------------

Regards,
JP.

Jul 22 '05 #3
Nathan Sokalski wrote:
I don't think that solves my problem, because I still have to make
everything into a string (in your example MyVar), which presents the same
problem I mentioned in solution #2.


Then why not encapsulate everything in a procedure :

template.asp :
<HTML><BODY>
Page Header
<%=MySub%>
Page Footer
</BODY></HTML>
-----------------

And your main page could be :
<%
Sub MySub
' some vbscript
%>
Some text with html tags
<%
End Sub
%>
<!-- #include file="template.asp" -->
------------------

JP.
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Phil | last post by:
I am using a Pascal like language (Wealth-Lab) on W2K and call this server: class HelloWorld: _reg_clsid_ = "{4E797C6A-5969-402F-8101-9C95453CF8F6}" _reg_desc_ = "Python Test COM Server"...
6
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
0
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: ...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
22
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
4
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.