View Full Version : Writing entire pages with Response.Write
tr0n2ooo
07-15-2002, 09:03 PM
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.
oracleguy
07-15-2002, 09:14 PM
How about something like:
<%
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.
Morgoth
07-16-2002, 07:43 PM
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>
whammy
07-17-2002, 02:03 AM
With Response
.Write("stuff" & vbcrlf)
.Write("some more stuff")
End With
Is another way...
I personally like the first idea though
whammy
07-17-2002, 02:05 AM
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?
:)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.