R
R
Roman Koff2018-05-21 13:44:02
JavaScript
Roman Koff, 2018-05-21 13:44:02

How to pass a list of checkboxes to a WebApi controller?

There is a list of positions, each of which corresponds to
Tell me how the webapi (post) controller method should look like and what code can data be sent to it?

upd:
Everything is sent by ajax, without submitting the page. Accordingly, it accepts the webapi controller method.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Eremin, 2018-05-21
@EreminD

https://docs.microsoft.com/en-us/aspnet/web-api/ov...

  1. Describe on the server side the class of the message that will arrive (a set of checkboxes)
  2. Create corresponding html form
  3. Specify the form method post and action = {your path where to send the request}

R
Roman Koff, 2018-05-21
@Zarinov

I forgot to clarify (got tired). Everything is sent by ajax, without submitting the page. Accordingly, it accepts the method of the webapi controller (through the form, I can do it, there are no questions there) ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question