I’m working in C#, and I want to POST to a website that has multiple checkboxes and returns a datafile depending on which checkboxes are checked.
First of all, how do I post a form with checked checkboxes ?
And once that is done, how do I get the datafile the site sends me ?
With this simple ASP code, we can see how checkboxes values are sent through a POST request:
tst.asp
The H3 line show us this, if we check all the checkboxes:
Now we know how the data should be posted. With the sample code below, you should be able to do it.
C# method sample
Hope I’ve helped.
Useful links: