How to validate non entity fields but just textboxes. Also add dynamic validations
I am new to Silverlight and want to achieve validations.
I have a form with accordion control. I have controls in each section and have to have validations like Required or optional, if given a value it has to be valid like emai, phone number..... All these validations i have Dynamically enable or disable at page load.
So How i can achieve this in Silverlight 4. In simple words how can we have Required field validator, CUstomvalidator and range validators in SilverLight.
I have gone through RIA but i am not sure how to use that on non entity fields and also Dynamically enable or disable validations.
Example i have txtFirstName, txtLastName and txtPhone. I want firstname required and Phone optional but should be validated if given some value.
All these fields are not part of any entity. Where i can add required or other attributes.
Thanks in advance.
You can add context to the validation process and allow your custom validators to be aware of some state. Fore example, you can add your page to the context and the validator can later access it to perform some conditional logic. See "RIA Services Validation: Providing ValidationContext" by Jeff Handley
How Silverlight Validation Works by Shawn Wildermuth.