views:

308

answers:

0

Hi Guyz!

I have a problem concerning the Webbrowser Control in VS2005 (.NET 2.0).

I have a site containing this html code:

Button which I want to submit Button that gets submitted

Okay, with SetAttribute (either in C# or Javascript) I'm changing the type attribute of button1 to "submit" and the type attribute of button2 to "button". This works of course.

But when I submit the Form like this:

mshtml.HTMLFormElement htmlfrm = (mshtml.HTMLFormElement)webBrowser1.Document.Forms[0].DomElement; htmlfrm.submit();

It submits button2! When I look at the OuterHtml property of htmlfrm, I see that it still has the old html code with button1 type="button" instead of button1 type="submit".

So how do I update the Form with the new information? Any help is welcome!