Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Help with ASP.net using VB: Control Validation
New Posts  All Forums:Forum Nav:

Help with ASP.net using VB: Control Validation

post #1 of 3
Thread Starter 
I am trying to validate a date and I want the user to enter a date that is at least 7 days from the current date. No matter what the user types into the field (a text box), it does not recognize it as a date and therefore fails the validation.

I have this code under the Page_load

CompareValidator1.ValueToCompare = DateAdd(DateInterval.Day, 7, Date.Now).Date

Thanks for any help
post #2 of 3
the best day to validate a date for that would prob be to assign it a number from jan 1st so feb 1 would be number 32 and jsut run a hceck to ensure its +7 from todays date
post #3 of 3
Thread Starter 
Thanks Onions, the code I posted actually does work I found out. All my code was right I just had one of the properties of the comparevalidator set wrong which is why it wasnt working right. Funny how one little property can cause an entire web form to not work properly.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Help with ASP.net using VB: Control Validation