data-annotations
How can I disable a form's submit button if there are DataAnnotation validation errors?
I\'ve attempted binding to the change eve开发者_JAVA百科nt of all inputs in the form, and checked to see if there are any validation messages on the page. The problem is that validation seems to occur[详细]
2023-03-28 00:05 分类:问答How to implement business and view validation without repeating code?
How do I avoid needing to 开发者_如何学JAVArepeat validation rules on both my ViewModels and business/domain objects?[详细]
2023-03-27 10:03 分类:问答Can Castle Validators work with DataAnnotations attributes?
Is there a way of making DataAnnotations attributes such as Required to work with Castle Validators? I know Castle has its own attributes - but I am wanting to use the same attrib开发者_StackOverflow[详细]
2023-03-27 04:10 分类:问答How to retrieve Data Annotations from code? (programmatically)
I\'m using System.ComponentModel.DataAnnotations to provide validation for my Entity Framework 4.1 project.[详细]
2023-03-27 03:42 分类:问答MVC3 Unobtrusive Validation not working for custom DataAnnotations attribute
I have a custom attribute that is currently a simple wrapper of the DataAnnotations.RequiredAttribute (I will extend it later, but just trying to get this proof of concept working for now).However, th[详细]
2023-03-27 02:33 分类:问答DataAnnotation and optional DateTime values
I\'m working with a HTML form that accepts 4 dates, two of which are optional. These dates are inserted into a MS SQL database, so I\'m boundary checking the DateTime variables, which are passed from[详细]
2023-03-26 09:39 分类:问答Is there a way to access DataAnnotations when building MVC3 EditorFor templates?
Suppose I have a view model with a pr开发者_运维知识库operty that looks something like this: [Required][详细]
2023-03-26 04:47 分类:问答EntityFramework and DataAnnotations, errors not showing
I am using the entity framework and trying to use Data Annotations for validation. I have looked up several examples on google and found the same structure everywhere. I followed it, but for some reas[详细]
2023-03-25 16:49 分类:问答Model Binding HTML control to Model Property with a different name
I have an HTML input control on one of my views that is called for example \'BodyInput\'. When I post the form I am checking if the ModelState is valid or not. The other few input controls on my view[详细]
2023-03-25 10:39 分类:问答Overriding DisplayFormat(DataFormatString)
public abstract class MyBaseClass { [DisplayFormat(DataFormatString = \"{0:0.00}\")] public virtual decimal Value[详细]
2023-03-25 04:20 分类:问答