[thelist] Response.Write versus varHTML = varHTML & "..."

Howard Cheng howcheng at ix.netcom.com
Mon Jan 14 11:48:05 CST 2002


Actually over the weekend I came up with a better solution than what I was 
saying earlier, about putting your ASP code in the middle of your HTML. We 
can still keep the same framework of query, calculation, and output, by 
using an array instead.

[%
strSQL = "SELECT ..."
objRS.Open strSQL, objConn, adOpenStatic, , adCmdText
iTotal = objRS.RecordCount
iCount = 0

Dim arText(iTotal)
While Not objRS.EOF
         arText(iCount) = objRS("field")
         iCount = iCount + 1
         objRS.MoveNext
Wend
objRS.Close
%]
[html]
[body]
[%
For Each strText In arText
         Response.Write strText & vbCRLF
Next
%]
[/body]
[/html]

How do ya like them apples?

At 11:02 AM 1/11/2002 -0800, Howard Cheng wrote:
>You'll have to output your HTML smack-dab in the middle of the page. The 
>whole ASP framework is designed so you can have jump in and out of 
>server-side code so I suppose that's how they expect you to do it, 
>intermixing your logic and presentation.

::::::::::::::::::::::
Howard Cheng
howcheng at ix.netcom.com
AIM: bennyphoebe
ICQ: 47319315





More information about the thelist mailing list