c# - How to Fire Submit button Click Event using WebRequest -


i have following html code , want fire click event of accept submit button using webrequest in c#

<form method="get" action="test">           <input class="accept" type="submit" value="accept">           <input class="decline" type="button" name="decline" value="decline"> </form> 

please let me know ways t0 achieve this.

thanks.

when click "accept", browser automatically send request specified action "test" on server hosting webpage contains form.

get http://example.com/test? 

here example illustrate "firing sumbit event" has nothing c#, feature of html.

let`s put form simple html page , save form.html somewhere on computer:

<html>     <body>         <form method="get" action="accepted.html">             <input class="accept" type="submit" value="accept">             <input class="decline" type="button" name="decline" value="decline">         </form>     </body> </html> 

note action goes "accepted.html". put html file called "accepted.html" same folder form.html. when open form.html in browser , click "accept", static page accepted.html shown. (here webbrowser acts server local files.)

so question not "how fire click event of submit button" rather "how handle dynamic requests instead of serving static pages".

you want webserver intercept request action 'test', run c# process , show results. framework asp.net mvc.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -