I'm trying to achieve the following:
Where:
- Surname is always required
- NI Number OR Reference Number is required
Is this beyond the scop开发者_如何学JAVAe of the ASP.NET Validation Controls? The only solution I can think of is writing some bespoke javascript (for client side) and backing that up with some server side code.
One thing you can try is to have a CustomValidator
(see here) check that both textboxes are not
empty. Then validate both textboxes with a regular expression. The expression should check for either a valid entry OR a blank field.
You can create a CustomValidator and handle it there
http://msdn.microsoft.com/en-us/library/aa479013.aspx#aspnet-validateaspnetservercontrols_topic7
精彩评论