我有一些调试消息(通过Response.Write()编写),当我执行“查看源代码”时,我可以看到(在VB代码中):
currentYear = Year(Now) sqlString = "Select NewBiz from MasterUnitsprojSales where CYear = " & currentYear & " and Unit = '" & Unit & "'" adoRS = New ADODB.Recordset adoRS.Open(sqlString,adoCon) IsNewBusiness = TRUE 'default (if record not found) Category = "New Business" If Not adoRS.EOF Then IsNewBusiness = adoRS.Fields.Item(0).Value <> 0 if Not IsNewBusiness Category = "Existing Business" End If Response.Write("<!-- IsNewBusiness after NOT EOF assignment = " & CStr(IsNewBusiness) & "-->") End If adoRS.Close()
– 和(在hmtl内):
<% Response.Write("<!-- Is New Biz = " & IsNewBusiness & "-->") %>
但我还有其他类似的实例没有写出来,例如:
If Request.Form.Item("Action") = "Save" Then Response.Write("<!-- Made it into the Action =Save block -->") . . .
我知道这个块已经到达,因为它中的逻辑正在发生(数据库插入).
为什么Response.Write()并不总是有效?