I have a sub that checks the minimum value of a textbox
Public Sub ValidCheck()
rvCompDateCheck.MinimumValue = DateTime.Today.AddDays(-7).ToShortDateString()
rvCompDateCheck.MaximumValue = DateTime.Today.ToShortDateString()
It worked until yesterday(31/10/2016)
Now today (01/11/2016)
I get the below error
The MaximumValue 01/11/2016 cannot be less than the MinimumValue 25/10/2016 of rvCompDateCheck.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The MaximumValue 01/11/2016 cannot be less than the MinimumValue 25/10/2016 of rvCompDateCheck.
I know its something to do with it reading the date as a string but can't find the right solution... help. Thanks