I have a .ASPX page, code behind it and I have a class containing a library of data validation functions. I call many of these data validation functions from the code behind.
One of the data validation functions in the library loops through an array of validation rules and performs various "standard" validations (e.g. valid date, valid currency, value in range etc).
What I'd like to be able to do within the function is, if I encounter a "non-standard" validation rule that I don't recognise (e.g. postcode validation), then I'd like to "callback" a function within the original code behind the .ASPX page to process that one rule within the array and continue to process the loop.
How might I go about this please? Do I need to use Delegates somehow? Or can I pass through a reference to the .aspx page so that the code within it can be referenced by the library somehow?
Apologies for dominating the forum somewhat.
One of the data validation functions in the library loops through an array of validation rules and performs various "standard" validations (e.g. valid date, valid currency, value in range etc).
What I'd like to be able to do within the function is, if I encounter a "non-standard" validation rule that I don't recognise (e.g. postcode validation), then I'd like to "callback" a function within the original code behind the .ASPX page to process that one rule within the array and continue to process the loop.
How might I go about this please? Do I need to use Delegates somehow? Or can I pass through a reference to the .aspx page so that the code within it can be referenced by the library somehow?
Apologies for dominating the forum somewhat.