ksfok
asked on
ASP.NET date range validation
In Page_Load() of a regular ASP.NET page the below code can be used for date range validation:
RangeValidator1.Maximum = DateTime.Today.ToShortDate String()
But how can that code be put in a Formview's Edit or Insert Template for a range validator's MaximumValue=""?
Thanks
RangeValidator1.Maximum = DateTime.Today.ToShortDate
But how can that code be put in a Formview's Edit or Insert Template for a range validator's MaximumValue=""?
Thanks
ASKER
The following code:
Control myControl = FindControl("valHireDateRa nge");
generates:
The type or namespace name 'Control' could not be found (are you missing a using directive or an assembly reference?)
Please advise.
Control myControl = FindControl("valHireDateRa
generates:
The type or namespace name 'Control' could not be found (are you missing a using directive or an assembly reference?)
Please advise.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
it's depending on the structure of the page.
mybe on page_load event the object in't yet available.
try an later event.
you also should use "findcontrol" to find the object RangeValidator1