views:

230

answers:

1

I am using ASP.NET MVC 1.0. I am creating a view to Create a new object of the following class

public class ClassOne
{
    public string Name {get; set;}
    public string Id {get; set; }
    public CaptionItem Caption {get; set;}
}

public class CaptionItem
{
    public string CaptionSet {get; set;}
    public string Text {get; set;}
}

The view will have fields to input Name, Id and the Text of the caption. On submitting the form the ClassOne object is sent to the controller which is supposed to persist the object in the database.

The question is; what should be the naming conventions used so that I can send the object to the controller as

public ActionResult SaveObject(ClassOne objectToSave)

The challenge is the Caption object

A: 

you're right, to get to Text field you have to type Caption.Text :)

Jack