Reputation: 10509
In ASP.NET MVC 3 I can use a set of special validation attributes, to have a client-side and server-side model validation.
Is there anything similar provided by silverlight out-of-the-box for TextBox control? If I want to check if the Silverlight text box user has been editing is empty, do I need to implement this logic myself?
Upvotes: 1
Views: 425
Reputation: 65064
There are a number of attributes in the System.ComponentModel.DataAnnotations namespace that can be used for validation. These attributes are applied to the view-model property that you bind the Text of the TextBox to.
These attributes don't do any server-side validation, but that might not be too much of an issue. You can sidestep client-side validation in ASP.NET MVC (or any web application for that matter) by disabling JavaScript in the browser. However, it's much trickier to sidestep the validation in your Silverlight application - disabling the Silverlight plugin would disable your entire Silverlight application.
Upvotes: 1