asp.netcomparevalidator

CompareValidator works on local PC but doesn't work on server


I have added a CompareValidator to compare the dates as below:

 <asp:CompareValidator ID="cmpFromToTodate" runat="server" CultureInvariantValues="true" 
      ControlToValidate="dtpToDate" ControlToCompare="dtpFromDate"
      ErrorMessage="To Date Should be Greater than or Euqal to From Date"
      Operator="GreaterThanEqual" Type="Date">

This works when developing in local PC, but not when I host this page to a server. Here I have added some screenshots.

Local Browser Screenshot: Local Browser Screenshot

Screenshot after hosting the page to server: Screenshot after hosting the page to server


Solution

  • i think error occur for local and server time format . Please print server time format and check it. i hope it help you