Reputation: 4111
I'm using the webBrowser control to surf to a page that has an Iframe. I access the Iframe object like this:
WebBrowser1.Document.Window.Frames["IFrameName"]
The problem is that sometimes the Frames collection has no frames and sometimes it does.
What might be the reason that the same exact code one time works fine and i get the iframe and few minutes later it's throwing an exception because the frame is not there?
Upvotes: 0
Views: 447
Reputation: 17680
AT what point are u making the call to the Frames collection? Are you doing this after the DocumentCompleted event?
That could make a difference ... you could handle the documentcompleted event and only make the call after the document has loaded.
Upvotes: 1