From: - Electronic.HR - on 5 Jun 2007 17:14 "Nicholas Paldino [.NET/C# MVP]" <mvp(a)spam.guard.caspershouse.com> wrote in message news:%23VsOEO7pHHA.3264(a)TK2MSFTNGP04.phx.gbl... > Well, by default, exceptions thrown by event handlers on controls are > swallowed. You will have to wrap in a try/catch block to figure out what > the exception is (you can look at it in the debugger too). > Try/catch gives no result....no exception..code just continues... .... Now, when I call webBrowser1.Navigate(...), and watch DocumentText in debugger after DocumentCompleted event this is what I get: <DOCUMENT_TEXT> - DocumentText '((System.Windows.Forms.WebBrowser)(sender)).DocumentText' threw an exception of type 'System.IO.FileNotFoundException' string {System.IO.FileNotFoundException} - base {"The system cannot find the file specified. (Exception from HRESULT: 0x80070002)":null} System.IO.IOException {System.IO.FileNotFoundException} - FileName null string - FusionLog null string - Message "The system cannot find the file specified. (Exception from HRESULT: 0x80070002)" string </DOCUMENT_TEXT> but.. when I click on a link in webBrowser and then look at DocumentText after DocumentCompleted event i get this: - DocumentText -> it's value is HTML content of a page, and type is string...all is prefect :-( I really don't have idea why is this happening... p.s. Thanks for helping, Nicholas :)
From: Nicholas Paldino [.NET/C# MVP] on 5 Jun 2007 17:19 Im only suggesting wrapping the first call in the event handler to the DocumentText property, not the whole thing. Regardless, if that second line was not executing, then an exception could be the onlyh reason. -- - Nicholas Paldino [.NET/C# MVP] - mvp(a)spam.guard.caspershouse.com "- Electronic.HR -" <electronic.hr(a)gmail.com> wrote in message news:f44jlk$q0s$1(a)news1.carnet.hr... > "Nicholas Paldino [.NET/C# MVP]" <mvp(a)spam.guard.caspershouse.com> wrote > in message news:%23VsOEO7pHHA.3264(a)TK2MSFTNGP04.phx.gbl... >> Well, by default, exceptions thrown by event handlers on controls are >> swallowed. You will have to wrap in a try/catch block to figure out what >> the exception is (you can look at it in the debugger too). >> > > Try/catch gives no result....no exception..code just continues... > ... > Now, when I call webBrowser1.Navigate(...), and watch DocumentText in > debugger after DocumentCompleted event this is what I get: > > <DOCUMENT_TEXT> > - DocumentText '((System.Windows.Forms.WebBrowser)(sender)).DocumentText' > threw an exception of type 'System.IO.FileNotFoundException' string > {System.IO.FileNotFoundException} > - base {"The system cannot find the file specified. (Exception from > HRESULT: 0x80070002)":null} System.IO.IOException > {System.IO.FileNotFoundException} > - FileName null string > - FusionLog null string > - Message "The system cannot find the file specified. (Exception from > HRESULT: 0x80070002)" string > > </DOCUMENT_TEXT> > > but.. when I click on a link in webBrowser and then look at DocumentText > after DocumentCompleted event i get this: > - DocumentText -> it's value is HTML content of a page, and type is > string...all is prefect :-( > > > I really don't have idea why is this happening... > > p.s. Thanks for helping, Nicholas :) > > > >
From: - Electronic.HR - on 5 Jun 2007 17:58 Hm.. I can't believe.. LOL... Problem is that webBrowser control MUST be FOCUSED before taking DocumentText... :) When I click on a link in browser it get's automaticly focused, that's why I always got DocumentText when I clicked link.. but When I call navigate, webbrowser doesn't get focused, so i have to focus it manually before taking DocumentText... Anyway, thanks a lot for helping! ;) BR
First
|
Prev
|
Pages: 1 2 Prev: DHCP SuperScopes Next: How to use HostCurrentCallback in TransactionManager? |