Results 1 to 2 of 2

Thread: writing HTML

  1. #1
    Join Date
    Jan 2004

    Unanswered: writing HTML

    How do you write HTML using Response.Write so the HTML tags are recognized? Is there a tutorial on the basic method to do this?

    For example, if I want to just generate an HTML page in its basic structure:

    <title>My Title</title>

    <div id="container">
    <div id="tophdr"></div>
    <div id="main"></div>
    <div id="footer"></div>

    I'm just trying to get a starting point on how to write HTML output using ASP. Thanks for any help.

  2. #2
    Join Date
    May 2004
    I'm not sure if I'm understanding what you mean by recognized. Once the parser on the server is done with your asp code and sends it to the browser its sent as plain text. As long as you set up your response.write statements properly the browser will parse them like any other html tags.

    Using your example:

    response.write "<html>"
    response.write "<head>"
    response.write "<title>My Title</title>"
    response.write "</head>"

    response.write "<body>"
    response.write "<div id=""container"">"
    response.write "<div id=""tophdr""></div>"
    response.write "<div id=""main""></div>"
    response.write "<div id=""footer""></div>"
    response.write "</div>"
    response.write "</body>"
    response.write "</html>"

    If you want your html to be readable you can put in & "<BR>" Also note since some of your html tags has a double quote so I had to use two double quotes<""> so that the parser will print out one double quote to the screen.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts