I am just curious as to when it is better to use straight HTML or ASP
(response.write) to put out HTML code on an ASP page.
For example, if I have an ASP page that is including another ASP page,
but the rest of the code is just HTML, which is the better way to do it.
Here is my example:
The file I am including in my ASP file (banner.asp).
************************************************** ****************
<%
Response.Write("<P>Welcome to my Web site! ")
Response.Write("The time of your visit is " & Time &"<BR>")
%>
************************************************** ****************
The ASP file that is including this file can be done one of 2 ways. The
first way displays the HTML code as response.writes:
************************************************** ***************
<HTML>
<HEAD>
<TITLE>Ultimate Parenting Resource</TITLE>
</HEAD>
<BODY>
<%
Response.Write("<H1>The Ultimate Parenting Resource</H1>")
Server.Execute("banner.asp")
Response.Write("<BR>You can browse this Web site to find ")
Response.Write("information concerning everything from ")
Response.Write("bathing baby to buying the perfect prom ")
Response.Write("outfit for your teenager!")
%>
<P>
Thank-you for visiting The Ultimate Parenting Resource.
</BODY>
</HTML>
************************************************** ***************
The other way just uses ASP code for the Server.Execute statement and
puts all the rest as straight HTML code:
************************************************** *****************
<HTML>
<HEAD>
<TITLE>Ultimate Parenting Resource</TITLE>
</HEAD>
<BODY>
<H1>The Ultimate Parenting Resource</H1>
<%
Server.Execute("banner.asp")
%>
<BR>You can browse this Web site to find
information concerning everything from
bathing baby to buying the perfect prom
outfit for your teenager!
<P>
Thank-you for visiting The Ultimate Parenting Resource.
</BODY>
</HTML>
************************************************** ****************
The result is the same page. Is one way better than the other? If so, why?
Thanks,
Tom.