-1

I'm debugging an html form. I need to POST the form with the default values (some of the field values are set with JavaScript).

How can I do this programmatically in C#? I want to have an action similar to pressing the "SUBMIT" button. I'm using a WebBrowser of my own.

Thanks.

4

2 回答 2

0

You could do it via JavaScript in the HTML, or the browser developer tools:

document.getElementByTagname('form').submit();

Just put that in a script-tag at the bottom of your HTML, and it will post the form. Not really sure why you can't just click the "submit" button, though..

于 2012-08-10T06:39:13.243 回答
0

I suppose what you want is to submit your form with the default values, though it needs to be submitted through server side i.e. c#?

You can avoid any client side processing for your form by changing certain attributes of the form tag. This post has some useful information for your taste.

于 2012-08-10T07:37:42.710 回答