How to fake a button click for HTTP form button

H

harleyman1974

I need to programatically "click" a form button from a c++ or c#
application which is found on a page.

I need to post data to a page and have it interpret the post as a click
occured, but I am not sure how to do this. Help?
 
S

Siva M

Just call the event handler method directly. Perhaps you can pass null for
both sender (object) and e (EventArgs) parameters.

I need to programatically "click" a form button from a c++ or c#
application which is found on a page.

I need to post data to a page and have it interpret the post as a click
occured, but I am not sure how to do this. Help?
 
J

Joerg Jooss

Siva said:
Just call the event handler method directly. Perhaps you can pass
null for both sender (object) and e (EventArgs) parameters.

This would be a pure server-side solution, but if I understood the OP
correctly, he wants to simulate from the client-side.

In order to send a HTTP POST with form data, use
System.Net.WebClient.UploadValues(). That's the easiest approach.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top