Last post Jul 27, 2018 06:52 AM by Yuki Tao
Jul 26, 2018 01:24 AM|svibuk|LINK
in a form in mvc i have few radio button and checkbox(multiselect) controls.
in add mode i am able to save data checkbox control data is saved as comma seperated values
radio button is working fine but in edit mode not able to bind those values to the checkbox inthe view
there is no error but data not getting binded
Jul 26, 2018 05:39 AM|stefanivovic|LINK
are you using bootstrap
are you passing right data to your model in action and then to your view
paste some code like action and view
Jul 27, 2018 06:52 AM|Yuki Tao|LINK
Since you did not post any code,I can't reproduce your issue.
Do you pass the model by id from controller to view?
I suggest you could refer to the below:
in httpget Eidt action:
public ActionResult Edit(int? id)
ModelXXX model= db.ModelXXXs.Find(id); //get the model by id
if (author == null)
return View(model); //pass model to view
@Html.CheckBoxFor(m => m.XXX)
If you have any questions,please post more details,so that I can understand your need better.