validationattribute
ASP.NET MVC ValidationAttribute Get Other Property Display Name
I have created a custom CompareLessThan validation attribute by copying the ASP.NET MVC 3 CompareAttribute and instead of checking for equality, I check to see that one property is less than another.[详细]
2023-04-13 02:15 分类:问答How to serialize a model with all validation attributes from the individual properties?
Context: creating a jsonP service with mvc controller methods which provides a definition of formfields including all validation rules.[详细]
2023-03-14 07:43 分类:问答Validate private properties using ValidationAttributes in .net 4
I have classes which get private properties set via the constructor. I would then like to run the following code from a base class to check if the passed values are ok:[详细]
2023-02-24 07:51 分类:问答Custom Validation in MVC - Match New Email To Confirmed Email
I am trying to create a new custom validation in which I can compare two values within the same class. in this case its checking that when people change their email they have to enter it twice and tho[详细]
2023-02-14 04:05 分类:问答CustomValidationAttribute doesn't work when other attributes are applied to the class
Reproduction: Imports System.ComponentModel Imports System.ComponentModel.DataAnnotations Module Module1[详细]
2023-02-13 11:27 分类:问答Securing against JS injection with ASP.NET MVC
I would like to allow users to post HTML to a site but need to ensure that no Javascript is injected into the site.[详细]
2023-02-11 14:16 分类:问答MVC3 ValidationAttribute break
I upgraded my project from MVC2 to MVC3 and all custom ValidationAttributes broke. At some point in the 开发者_如何学Gomodel binder phase, it throws this exception:[详细]
2023-02-05 20:13 分类:问答How to call ValidationAttributes manually? (DataAnnotations and ModelState)
We have a need within some of our logic to iterate through the properties of a model to auto-bind properties and want to extend the functionality to include the new dataannotations in C# 4.0.[详细]
2023-01-30 01:24 分类:问答How can I have a custom ValidationAttribute rendered as a 'data-val-xx' attribute on the client-side?
Given a ViewModel that looks like this: public class Login { [Required] public string Username { get; set; }[详细]
2023-01-23 18:39 分类:问答How come module-level validators are evaluated only after property-level validators?
I\'m using the module-level validator: \'PropertiesMustMatch\' on my view-model, like so: [PropertiesMustMatch(\"Password\", \"PasswordConfirm\")][详细]
2023-01-01 07:21 分类:问答