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>
1

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.