Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

in c# show error when user choose old datetime

if (DateTime.Compare(fromDate, toDate) > 0)
            {
                lblMessage.Text = "From Date Should Be Less Than To Date";
                return;
            }
            if (DateTime.Compare(fromDate, DateTime.Now) > 0 || DateTime.Compare(toDate, DateTime.Now) > 0)
            {
                //lblMessage.Text = "Date Cannot Be Greater Than Today's Date";
                lblMessage.Text = "Exceeded Today's Date";
                return;
            }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #show #error #user #choose #datetime
ADD COMMENT
Topic
Name
4+1 =