Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Writing entire pages with Response.Write

    Hi, I was wondering how to write large responses, like an entire web page. The quotes can get kind of tricky. Any help would be appreciated.

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    How about something like:

    Code:
    <%
    your ASP code
    
    %>
    
    <HTML>
    <HEAD>
    <TITLE><%=VarPageTitle%></TITLE>
    </HEAD>
    
    <BODY>
    <p>
    <%=Text%>
    </p>
    </BODY>
    </HTML>
    Hopefully you get it. You can mix HTML in with your ASP coding. So like you set a variable with the page's title and then you just insert that variable into your HTML.
    OracleGuy

  • #3
    Senior Coder Morgoth's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada Remaining Brain Cells: 6
    Posts
    1,402
    Thanks
    2
    Thanked 1 Time in 1 Post
    Now, if you want all the code to be with response.write then just:

    Response.Write "<HTML>"
    Response.Write "<HEAD>"
    Response.Write "<TITLE>"
    Response.Write "HELLO WORLD"
    Response.Write "</TITLE>"
    Response.Write "</HEAD>"
    Response.Write "<BODY>"
    Response.Write "<FONT SIZE=7>"
    Response.Write "HELLO WORLD"
    Response.Write "</FONT>"
    Response.Write "</BODY>"
    Response.Write "</HTML>"


    Or even:

    Response.Write "<HTML>" & vbcrlf & "<HEAD>" & vbcrlf & "<TITLE>" & vbcrlf & "HELLO WORLD" & vbcrlf & "</TITLE>" & vbcrlf & "</HEAD>" & vbcrlf & "<BODY>" & vbcrlf & "<FONT SIZE=7>" & vbcrlf & "HELLO WORLD" & vbcrlf & "</FONT>" & vbcrlf & "</BODY>" & vbcrlf & "</HTML>"

    Same result of:

    <HTML>
    <HEAD>
    <TITLE>
    HELLO WORLD
    </TITLE>
    </HEAD>
    <BODY>
    <FONT SIZE=7>
    HELLO WORLD
    </FONT>
    </BODY>
    </HTML>

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    With Response
    .Write("stuff" & vbcrlf)
    .Write("some more stuff")
    End With

    Is another way...

    I personally like the first idea though
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    By the way, the quotes aren't really tricky at all (although they seem that way at first!)... you just have to escape a quote with another quote... like:

    Response.Write("<a href=""blah.asp"">Link</a>")

    Get it?

    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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