The Webbrowser DocumentComplited event wont fire c#
Posted
by Igal B.
on Stack Overflow
See other posts from Stack Overflow
or by Igal B.
Published on 2010-04-01T17:25:17Z
Indexed on
2010/04/01
17:33 UTC
Read the original article
Hit count: 332
Hi. I have a problem using C# Webbrowser control. the problem is with the event DocumentComplited. Usually the event works fine. the problem is with this page:http://www.voiproblem.com/emulators/Netgear/WGR614v6/fw_forward.html
when I (automatically) press on "add" the control navigates to:http://www.voiproblem.com/emulators/Netgear/WGR614v6/pforward.html. but it never firing the DocumentComplited event. I build a simple application that does the same and there it works fine. I mean when the app invokes InvokeMember("click") it does go to the DocumentComplited event. in my real app it doesnt. anyone can help me to figure it up what is the problem? thanks.
<code>
private void button1_Click(object sender, EventArgs e)
{
webBrowser1.Navigate("http://www.voiproblem.com/emulators/Netgear/WGR614v6/fw_forward.html");
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
HtmlElement elm = webBrowser1.Document.GetElementById("Add");
if (elm != null)
webBrowser1.Document.GetElementById("Add").InvokeMember("click");
}
</code>
© Stack Overflow or respective owner