MVC post a list of complex objects

前端 未结 5 1892
眼角桃花
眼角桃花 2020-11-30 06:41

I have a FeedbackViewModel that contains a list of questions:

public class FeedbackViewModel
{
    public List Questions { get; set;         


        
5条回答
  •  [愿得一人]
    2020-11-30 07:29

    I use this code maybe its can help

    
    
    @Html.Raw(Html.EditorFor(modelItem => item.NameDale, new { htmlAttributes = new { @class = "form-control" } })
    .ToString().Replace("item.NameDale", "OffersCampaignDale[" + item.ID+ "].NameDale").Replace("item_NameDale", "NameDale-" + item.ID))
    @Html.ValidationMessageFor(modelItem => item.NameDale, "", new { @class = "text-danger" })
    

提交回复
热议问题