I'm using MVC 2, and the Html.EditorForModel() to allow me to display an editor for the model.
I am using a model which looks something like this:
public class LoanACar
{
[DisplayNameFromResource("VehicleDetails")]
public string VehicleDetails { get; set; }
[DisplayNameFromResource("VehicleId")]
[Required]
public long VehicleId { get; set; }
[DisplayNameFromResource("LoanCentreId")]
[Required]
public long LoanCentreId { get; set; }
[DisplayNameFromResource("StartDate")]
[Required]
public DateTime StartDate { get; set; }
[DisplayNameFromResource("EndDate")]
[Required]
public DateTime EndDate { get; set; }
}
Which is working great.
I'd like to take it further now and have my VehicleDetails to be a label, not a textbox, also the VehicleId to be a hidden.