ASP.NET Validation Suggestion

WOIM

New Member
Simply, right now I have 8 textboxes going from left to right and a label on the far right.It's like an employee worksheet for a time table where you put in the times intoeach textbox and it calculates time and outputs to a label on the right.Now, I need to validate numbers in each textbox and 1st textbox is "in" and 2nd is "out"and 3rd is "in" again and 4th is "out" again and so forth.Validation tasks would be
  • if they're all numbers
  • if numbers are between ranges (having user input . instead of : for times in minutes) so 1:39 would be 1.39 and there can't be forexample 2.61. 1<=x<=1.59.
  • after an "in", there has to be a following "out" and cannot be followed immediately by an "in"
  • for example, 1st box and 4th box can have some values and 2nd and 3rd could be empty. However, value in 4th box has to be equal to or greater than 1st box.
I don't know how to tackle this. I need a clean, simple, manageable, scalable and elegant programming construct. Is there a way?I tried validator controls but there's limits. Should I have a function for each validation task and call every one of them? (I have a button called calculate that'll start all this).I imagined this to be a simple solution for an ownerbut it's getting very complicated and hectic. Can someone tip in the right direction?Sorry for the complex rules. By the way, I'm pretty new to ASP.NET and wanted tosee how a guru would tackle this problem.Please help.
 
Back
Top