0

I have below code and need to pass it to my controller method on jQuery and read list of data on controller but have no idea to do it:

<p class="accounts form-inline">
<label class="checkbox"><input type="checkbox" name="accounts[0].IsSelected" value="true">ehsan.davodi<input type="hidden" name="accounts[0].AccountId" value="1"></label>
<label class="checkbox"><input type="checkbox" name="accounts[1].IsSelected" value="true">e_davodi<input type="hidden" name="accounts[1].AccountId" value="2"></label>
</p>
Ehsan Davoudi
  • 185
  • 1
  • 4
  • 11

1 Answers1

1

Well you'll need to use a form to post the data. Something like in your View:

@using(Html.BeginForm())
{
    ... your form elements here ...
}

To do this with AJAX, you'll want to use Ajax.BeginForm(), of which you can read an example in this StackOverflow question.

Community
  • 1
  • 1
dav_i
  • 27,509
  • 17
  • 104
  • 136