I have a date picker one for begin date and end date, i wanted to check to make sure that the user selects dates so that the begin date is before the end date.
thanks...
I have a date picker one for begin date and end date, i wanted to check to make sure that the user selects dates so that the begin date is before the end date.
thanks...
Thanks for everyone's help - this is what i was able to conclude. This is what i added to my post in my controller.cs:
if (viewModel.BeginDate == null)
viewModel.BeginDate = DateTime.Today.AddMonths(-6);
if (viewModel.EndDate == null)
viewModel.EndDate = DateTime.Today;
if (viewModel.EndDate < viewModel.BeginDate)
ModelState.AddModelError("", "Invalid Date Range");
if (string.IsNullOrEmpty(viewModel.Value))
ModelState.AddModelError("", "No View Selected");