Results 1 to 3 of 3

Thread: ASP and HTML question.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    San Jose
    Posts
    276

    Question 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>
    Tiny Mickey

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    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.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    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
  •  



Click Here to Expand Forum to Full Width