The Webbrowser DocumentComplited event wont fire c#
- by Igal B.
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>