user989888 user989888 - 1 year ago 138 Question

Working with frames in webbrowser Control

I am using

to get frames.
having 2 frames.My only problem is ,I seem one at index 0, but not 1.

Any help?

HtmlWindow wf = wb.Document.Window.Frames[1];
string s = wf.Document.Body.OuterHtml;

and view source

<frameset rows="0,*" border="0" frameborder="0" framespacing="0">
<frame name="entrustTruePassAppletFrame" src="EntrustTruePassApplet.html" marginwidth="0" marginheight="0" scrolling="no" noresize>
<!-- It is mandatory for the frame where the user interaction happens to have the name defined in the Configuration as appletHtmlGuiTarget-->
<frame name="entrustTruePassGuiFrame" src="AuthenticateUserInputRoamingEPF.html"> </frameset>

Answer Source

Try getting frames using their name instead of index:


Actually I think using index is not good at all, because if at a later time you add/remove a single frame it ruins all your work as the indexes changes.