ChefInput with Person Class

May 29, 2012 at 8:51 PM

I modified the Chef vm with:

pubic int PersonId {get;set} &  public Person Person {get; set;}

and created the necessary views.

The create works fine and Chef has a PersonID in the table.

However, when I click to edit chef, while I see a PersonID, there are no Person class primitives, and as such, data such as FirstName, LastName do not appear in the appropriate textboxes in my view.

Any suggestions?

May 30, 2012 at 5:18 PM

I suppose you didn't bound them, how do you bind the Person to the View ?

May 30, 2012 at 5:24 PM

IN the Chef create/edit view I have:

@Html.EditorFor(x => x.Person)

Like I said, The Person row is created and Chef has the correct PersonId in its table, but when I click back to edit no person data.

 

 

 

May 30, 2012 at 5:28 PM

I guess the modelbinder cant bind it back into the model. didnt saw any nested viewmodels examples in prodinner/ and I didnt ever used, so ...

May 30, 2012 at 5:30 PM

gee, you're alot of help