ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to get the list of checked values after an AjaxCheckboxList submit
Title:
B
I
{code}
?
Hi, I have an ajaxcheckboxlist in a view like @Html.Awe().AjaxCheckboxList("Prestations") And a controller with the action: public ActionResult GetItems(Guid[] v) { v = v ?? new Guid[] { }; return Json(db.Prestations.ToList().Select(o => new SelectableItem(o.IdPrestation, o.LibellePrestation, v.Contains(o.IdPrestation)))); } It works normaly now my question is : How can i have my checked items list after my form submiting? Thanks
Save Changes
Cancel
ousmane.nacanabo
asked at 07 Apr 2014
you can see this in the demo http://demo.aspnetawesome.com/Unobtrusive, in short it's the same as you would do it for anything else, for a textbox you put a string property in your model, for a lookup it might be an int (for the Id of the selected item) for the AjaxCheckboxList it could be an int[] or IEnymerable<int>, in your case Guid[] or string[] named Prestations
at 08 Apr 2014
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK