Html.Awe().AjaxCheckboxListFor not working when used in RenderPartial...

Oct 6, 2014 at 11:08 AM
Hello,

I have a view with "IEnumerable" collection as a model to view. In this view i call "Html.RenderPartial" for every obect. In the partial view "Html.Awe().AjaxCheckboxListFor" is used.

However "Html.Awe().AjaxCheckboxListFor" is showing only one checkbox list.

Any idea?
Coordinator
Oct 6, 2014 at 12:21 PM
well, since it's showing something, it means it's working, you should debug the GetItems method and see what it returns,
you can also see the GetItems request (and result) in the browser console (F12 or Ctrl+Shift+I in chrome)
Marked as answer by santoshmalisp on 10/6/2014 at 4:57 AM
Oct 6, 2014 at 12:57 PM
Yes, you are right. Problem was inside my partial view.

Thanks for your reply.
Oct 7, 2014 at 9:50 AM
Do you have any example where you have used multiple "AjaxCheckboxListFor" on the same view?

Currently when i am posting the data back to the controller values are not getting populated correctly.
Coordinator
Oct 7, 2014 at 10:29 AM
on this page: http://demo.aspnetawesome.com and here http://demo.aspnetawesome.com/AjaxCheckBoxListDemo, there's multiple AjaxCheckboxList,
just make sure they have different ids, if you get same id on the same page it won't work, you can also you use .Prefix to add a prefix to the id (id is generated using prefix and name)