|
-
Nov 18th, 2002, 05:51 PM
#1
Thread Starter
Hyperactive Member
ASP and HTML question.
Anyone know why I put asp on top of HTML code and it didn't work. If I take it out, it works fine but my project need to write get data from previous page to insert in database. Thanks for any help
Here is my code:
<%@ Language=vbscript %>
<%
Response.Write "Hello"
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<table width="473" border="0" cellspacing="0" cellpadding="0" height="35">
<tr valign="bottom">
<td width="315" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="003366"><b>Your order has been sent!</b></font><br>
</td>
</tr>
<br>
<tr>
<td><a href="../default.htm">
<font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Click here to return to main menu</a><br>
</td>
</tr>
</table>
<br>
<!--start Copyright-->
<br>
<table>
<font face="Arial, Helvetica, sans-serif" size="1">Company Name<br>
</font><font face="Arial, Helvetica, sans-serif" size="1">Copyright ©
2002 Company Name. All Rights Reserved</font>.
</table>
</BODY>
</HTML>
-
Nov 18th, 2002, 06:06 PM
#2
the <HTML> tag denotes the top/begining of the HTML page. When it is encountered, certain header information is sent to the browser. The headers MUST be sent BEFORE any content is. If you send content BEFORE the header, such as using the Response.Write, then implied headers get sent. This causes a problem when the HTML tag is sent (sonce only one set of header data is allowed.) If you move the Response.Write "Hello" to AFTER the HTML tag, you should be Ok.
You can have all the ASP code before the HTML tag you want AS LONG AS IT DOESN'T write to the browser.
Hope that helps.
-
Nov 18th, 2002, 06:53 PM
#3
Frenzied Member
Try this:
Code:
<%@ Language=vbscript %>
<%
Response.buffer=True
Response.Write "Hello"
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<table width="473" border="0" cellspacing="0" cellpadding="0" height="35">
<tr valign="bottom">
<td width="315" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="003366"><b>Your order has been sent!</b></font><br>
</td>
</tr>
<br>
<tr>
<td><a href="../default.htm">
<font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Click here to return to main menu</a><br>
</td>
</tr>
</table>
<br>
<!--start Copyright-->
<br>
<table>
<font face="Arial, Helvetica, sans-serif" size="1">Company Name<br>
</font><font face="Arial, Helvetica, sans-serif" size="1">Copyright ©
2002 Company Name. All Rights Reserved</font>.
</table>
</BODY>
</HTML>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|