Skip to content

{ Tag Archives } validation

How to Avoid Cut and Paste Code with ASP.NET MVC 2 Model Validation

In this post, I will demonstrate how to make your own model validation attributes in order to share common validations throughout an ASP.NET MVC application, and which support MVC 2’s client-side validation feature.
Validating a ZIP Code
As an example, consider a model for an address.

public class EditModel
{
public Guid Id { get; set; [...]

Also tagged , ,

How Does Html.EnableClientValidation() Inject JavaScript?

For a project I’m currently working on, I have a need to add some JavaScript at the end of a page in an ASP.NET MVC application. Since this is part of what Html.EnableClientValidation does, I thought that I would check out that source code to see if there was any kind of generalized mechanism for [...]

Also tagged ,

Customizing jQuery Validation

While doing some bug fixing and cleanup in a web application, I had the chance to go a little deeper into the jQuery user input validation framework. There are many tutorials available about implementing custom validations. But what I wanted to do was to extend the default validations with my own code, while preserving the [...]

Also tagged ,

Bad Behavior has blocked 713 access attempts in the last 7 days.

Close