HtmlWeb.PostResponse never happens?

Topics: User Forum
Apr 16, 2008 at 6:51 PM
Can someone tell me why the post response event never gets fired in this example? PreRequest and PreHandleDocument both work:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

' test html web events

Dim web As New HtmlWeb

web.PreRequest = New _
HtmlWeb.PreRequestHandler(AddressOf OnPreRequest)

web.PreHandleDocument = New _
HtmlWeb.PreHandleDocumentHandler(AddressOf OnPreHandleDocument)

web.PostResponse = New _
HtmlWeb.PostResponseHandler(AddressOf OnPostResponse)

Dim doc As HtmlDocument
doc = web.Load("")

End Sub

Public Function OnPreRequest(ByVal request As Net.HttpWebRequest) As Boolean
End Function

Public Sub OnPostResponse(ByVal request As Net.HttpWebRequest, ByVal response As Net.HttpWebResponse)
'' this never gets called.
End Sub

Public Sub OnPreHandleDocument(ByVal document As HtmlDocument)
End Sub