How to fake a button click for HTTP form button

  • Thread starter Thread starter harleyman1974
  • Start date Start date
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?
 
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?
 
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

Back
Top