Hi,
here you have a code snippet:
<asp:TextBox ID="txt" Runat=server></asp:TextBox>
<asp:RangeValidator ID="validDate" Type=Date MinimumValue="2004-10-10"
MaximumValue="2004-10-11" ControlToValidate="txt" EnableClientScript="true"
ErrorMessage="invalid date" Runat=server Display=Dynamic />
<asp:ValidationSummary Runat=server
EnableClientScript=True></asp:ValidationSummary>
<asp:Button Runat=server ></asp:Button>
Now the dates a set static but to change this to make them dynamic add
something like this to the script section of your code:
validDate.MinimumValue = Now.AddYears(-3)
validDateMaximumValue = Now.AddDays(30)
I haven't tested all of this now but the concepts are these...
Bye
Cristian
"TN Bella" <ti********@nav-international.com> wrote in message
news:ux**************@TK2MSFTNGP12.phx.gbl...
Trying to check if an entry for an date is < 3 years to current date or 30 days from current date. How can I do this in asp.net....? Do I need
to use the customvalidation. Can anyone give me an example? Thanks in
advance for the help
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!