public bool page_IsValid() { bool result = true; if ((!Convert.IsDate(Request["start_date"])) | (!Convert.IsDate(Request["end_date"]))) { result = false; } else { if (Convert.ToDateTime(Request["start_date"]) > Convert.ToDateTime(Request["end_date"])) result = false; } return result; }
public bool page_IsValid() { DateTime start; DateTime end; return DateTime.TryParse(Request["start_date"], out start) && DateTime.TryParse(Request["end_date"], out end) && end>=start; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)