First, I'm new to MVC - and testing ASP.NET MVC3.
I want to create a page that looks like this:
Start Date: [Date] End Date: [Date Box] [Search Button]
[Results Table]
The user enters a start and end date (which should be checked), then they click the Search button and return with the corresponding results.
So how do I structure this? Here is my idea of ββthe Model class:
public class ResultSearchModel { [Required] [DataType((DataType.DateTime))] [DisplayName("Start Date")] public DateTime StartDate { get; set; } [Required] [DataType((DataType.DateTime))] [DisplayName("End Date")] public DateTime EndDate { get; set; } public List<ServiceEntry> ServiceEntries { get; set; } } public class ServiceEntry { public DateTime Date { get; set; } public string Code { get; set; } public string Details { get; set; } }
So, my action with the index controller is to construct an instance of ResultSearchModel and return a view with this model?
Am I doing this in one view, or do I need to have a partial view for part of the list?
source share