MVC4 - Partial View Model binding during Submit

前端 未结 7 2234
野趣味
野趣味 2021-02-19 19:29

I have view model which has another child model to render the partial view (below).

public class ExamResultsFormViewModel
{
    public PreliminaryInformationView         


        
7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-19 19:56

    For .net core 2 and mvc, use do like below:

    @{
     Html.ViewData.TemplateInfo.HtmlFieldPrefix = "Contact"; 
    }
     @await Html.PartialAsync("_YourPartialViewName", Model.Contact)
    

提交回复
热议问题