@model  SepiaCMSClassLib.Model.Page


<table>
    @using (Html.BeginForm())
    {

        <tr>
            <td width="300">

                @Html.EditorFor(m=>m.pagedetail)
            </td>

        </tr>

    }
</table>

My model

    public class Page
    {
     public int PageID { get; set; }
     public int SortId { get; set; }

     public List<PagesDetail> pagedetail { get; set; }
     }


    public class PagesDetail
    {
     public int PageTitle{ get; set; }
     public int PageDescription{ get; set; }
     public int LangId{ get; set; }

     }

In my action method i am passing nothing to this view as it is the create view

    public ActionResult Create()
    {         
        return View();
    }

The problem is that my editorfor template is loading when i pass data to it it is loading , it is not loading if i pass no data. i understand that is the default behavior. i wanted to use nested model binding ( only passing page model in the controller posts). Html.partial will not give the desired result of nested model binding

1) How can i use editorfor template approach in create view?

Related posts

Recent Viewed