我有一些调试封邮件(通过回复于()写的),我可以看到,当我做了一个“查看源文件”,像这样(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()不总是工作?
尝试将响应权限放在函数的最后,看看它是否有什么区别?它可能会做一个微型重新加载,你不会注意到。 – Deckerz