我有一些調試封郵件(通過回覆於()寫的),我可以看到,當我做了一個「查看源文件」,像這樣(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