I've got an aspx page with a VB.net backend. It's got a gridview which is populated from an object data source. I've also used a repeater in there, but that's immaterial. The page is displaying some invoice information. Depending on the record for that line, it could have a textbox input, a checkbox, or a calendar input. There's an authorized amount, and that's compared against the user's input. Specifically with the calendar input (where there's a possible value-per-day entered) if the total amount entered exceeds the authorized amount, validation fails.
My question is what is the best way to approach validation. The simple way, and the way that's already been in place for previous versions of this page, was just a server side validation that fired when the user clicked "submit." This is fine if there's 3 records, and 2 of them are calendars. But there are times that the page pulls up 500+ records (10 at a time per 'page' but still 500 to be done prior to clicking submit) and so obviously if some of those calendars exceeds the authorized amount, then the user has to dig through a lot to find and correct his or her errors.
Having had experience with Angular, I thought it might be a better approach to do all the validation in real time... have a model that is updated every time an entry occurs, and validation would fail the first time an entry happened that caused the total for that month to exceed its bounds. But these calendars are all created at run time dynamically, based properties of the object that comes from the business layer level object. So I'd have to create the models to go with each calendar at run time as well... I'm not even sure how you'd go about doing that... I could imagine creating a hidden (or visible, really) label that could store all the values, have it updated and checked "onKeyPress", but even that, I wouldn't be sure how to attach those watches to dynamically created textboxes... and I'm sure that would be a lot of work.
Am I best to stick with server side validation? The only other thought I had was to create the calendar as it's own class/control, with a validation method and a property that could be set at creation...
Thoughts?