Archived Forum Post

Index of archived forum posts


Duplicate HTML Form Example?

Oct 24 '12 at 11:27

I'm having trouble doing a simple post to this website using c# .net 4

I have tried few of your examples from your website but they all display the same message below. it should display firstname and lastname . could you please give me an example to see how you can accomplish a simple post like this. thank you.


The HTML form to be duplicated is this:

<!DOCTYPE html>

<form action="demo_form_method.asp" method="get" target="_blank"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <input type="submit" value="Submit"> </form>

<p>Click on the submit button, and the input will be sent to a page on the server called "demo_form_method.asp".</p>

</body> </html>

Notice that the form tag's "method" attribute is "get". Therefore, it's not sending a POST; it's sending a GET. To duplicate this form, simply call httpObject.QuickGetStr like this:

(in pseudo-code)
htmlStr = httpObject.QuickGetStr(""