Solved

Compare validator asp.net

Posted on 2014-02-11
1
209 Views
Last Modified: 2014-02-12
I have a date text box which gets populated by a date picker.I want to check and see if the date entered is not more then one year starting from today;s date. so if today is 2-10-14 and if date entered in that text box is 2-11-15 then i need the validator to throw an error. how do i do that

                        <asp:CompareValidator ID="cvcalBondEffDt" Text="*" Operator="DataTypeCheck" EnableClientScript="true"
                            runat="server" ErrorMessage="Invalid Effective date." ControlToValidate="calBondEffDt"
                            Type="Date" Display="Dynamic">
                        </asp:CompareValidator>
0
Comment
Question by:pratikshahse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
dejaanbu earned 500 total points
ID: 39853105
Set the valuetocompare property to one year + todays date in page_load event.
Then set the operator property to "lessthan"
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question