About 3,380,000 results
Open links in new tab
  1. Best Practices ViewModel Validation in ASP.NET MVC

    Jan 22, 2015 · $('#some-ajax-form').data('validator', null); $.validator.unobtrusive.parse('#some-ajax-form'); So I have some questions: Is there some other useful practises that could help centralize all …

  2. c# - ASP.NET MVC Conditional validation - Stack Overflow

    Mar 10, 2010 · How to use data annotations to do a conditional validation on model? For example, lets say we have the following model (Person and Senior): public class Person { [Required(ErrorMessage …

  3. c# - ASP.NET MVC - Validate Form Input - Stack Overflow

    Feb 20, 2015 · I am new to ASP.NET MVC. I am trying to validate some user input. The model behind my view looks like this: public class ViewModel { [Required] public int? Minimum { get; set; } [Required]

  4. ASP.NET MVC: Custom Validation by DataAnnotation

    Apr 19, 2013 · ASP.NET MVC: Custom Validation by DataAnnotation Asked 12 years, 8 months ago Modified 7 years, 8 months ago Viewed 178k times

  5. Conditional validation in ASP.NET Core MVC (RequiredIf)

    Sep 14, 2018 · I am trying to conditionally validate the field within ASP.NET Core MVC. I have two radio buttons. If I select Yes (for the Ownership) I want to make a field below required (Activity dropdown) …

  6. asp.net - How do I clear MVC client side validation errors when a ...

    This causes the client side validation to fire as expected, and display the '*required' message beside the invalid field. When the cancel button is clicked, I want to reset the client side MVC validation back to …

  7. c# - Manually invoking ModelState validation - Stack Overflow

    Jun 15, 2011 · I'm using ASP.NET MVC 3 code-first and I have added validation data annotations to my models. Here's an example model: public class Product { public int ProductId { get; set; } [Required(

  8. StringLength vs MaxLength attributes ASP.NET MVC with Entity …

    The maxlength attribute doesn't add this html attribute, instead it generates data validation attributes, meaning the user can type beyond the indicated length and that preventing longer input depends on …

  9. c# - Phone Number Validation MVC - Stack Overflow

    For display string format use the javascript to have a more dynamic user interaction, or a plugin for MVC mask, or just use a display format string properly. If you are new to MVC programming put this code …

  10. validation - Allow User to input HTML in ASP.NET MVC - ValidateInput …

    Sep 1, 2010 · For ASP.NET MVC 3 applications, when you need to post HTML back to your model, don’t use ValidateInput (false) to turn off Request Validation. Simply add [AllowHtml] to your model …