xval

Options for asp.net MVC Validation Framework

I'm thinking of two options right now for model-base validation for an ASP.net project I'm starting: xVal (Steve Sanderson's project) and the Enterprise module that Stephen Walther uses on this page I don't really know enough to talk about the preferences as I haven't used either of them yet. Any ideas? Update Using LinqToSql for ORM ...

asp.net mvc wizard form with xval

im using linqtosql and xval to validate server side and client side. im trying to do a wizard style form but cant pass the actual values accross different actions. any ideas? ...

MVC and XVal with drop downs - The value 'Please Select' is invalid.

Im following the approch outlined here to do this. Im having a problem with validating a dropdown selection with xval, the MVC binding seems to infer the wrong thing an allowing the operation to pass validation, but the modelstate stores the binding exception and makes the page invalid - so I get the situation where operation is allowed...

xVal validation with Spring.net

I have started to play with xVal as my validation framework for an ASP.Net MVC application. I use the Spring.Net IoC container to hold the app together. I have followed the instructions on Steve Sanderson's blog to get server side validation working fine. But when I try to get client side working, I get the following runtime exception:...

xVal and the ViewModel pattern - can it be done?

I've been adding xVal to the NerdDinner app - so far so good, I get client-side validation with jQuery.validate in one line, which is truly beautiful. But I can't seem to get xVal to validate a complex object. Say I have a Dinner object that looks like this: public class Dinner { [Required] public string Title { get; set; } } ...

AJAX Validation Idea - Complete with ValidationSummary & ValidationMessage

I have been looking at many ASP.Net MVC client side validation ideas including xVal. This doesn't provide a ValidationSummary at the moment so I chose to do an AJAX post which loops through ModelState errors and update a DIV with the error messages on a successful AJAX post. The problem with this is your ValidationMessage * next to t...

ASP.NET MVC ValidateInput(false) stops working with xVal and [RegularExpression] DataAnnotation

I would like to intercept the "<" character in the form field by a regex validator. I will describe the problem in 3 steps: Step 1: When I try to submit a form with a field containing the "<" character, I get the "Potentially dangerous request..." - as expected in ASP.NET. Step 2: To avoid ASP.NET's RequestValidation, I decorate my Upd...

An example of xVal with ASP.NET WebForms?

This is a two part question. Is it possible to take advantage of xVal's automatic client side validation with ASP.NET WebForms? If so, are there any examples available? I imagine that it would be possible to extend xVal to include ASP.NET Validator controls. These controls would be the WebForms equivalent of <%= Html.ClientSideValida...

xVal testing

Does anyone know how to generate a test for the xVal, or more the the point the DataAnnotations attributes Here is some same code that I would like to test [MetadataType(typeof(CategoryValidation))] public partial class Category : CustomValidation { } public class CategoryValidation { [Required] public string Categ...

Xval for two forms that reference the same fields from the same entity

Hi, I have a page with a login form that takes the User.LoginName and User.Password but also has a "create new account" form on the same page which has the same fields. Xval works great on the first form on the page but does not work on the second form. My first thought would be redirect to new page for register or use ajax for registe...

xVal - MVC: add a validation to all properties of a type

I have a MVC website with a complex model. I'm using xVal to do my validation by decorating my model properties with validation attributtes. I'm looking for at way to add a StringLengthRule to all properties of type string without manually adding a StringLengthAttributte to all the properties. One way to go was to make my own IRulesPro...

How to get Castle Client Side Validation with xVAl

Has anybody had problems using Castle and Client Side validation? I’ve found that only my numbers (Int, Decimal, Double, etc) gets picked up by ClientSideValidation. Strings, dates, enums and other properties do not. For instance, this class: public class MyClass { [ValidateNonEmpty] public string MyString { get; set; } [ValidateNonE...

nhibernate.validator & x.Val & jQuery with custom validators

Hello, I've been playing with nhibernate.validator and xVal and JQuery and they work together quite nicely, until I try to have custom validators. According to the xVal codeplex side custom validators are supported if they implement the ICustomRule interface. and you supply the ToCustomRule function which returns a customRule with t...

xVal error messages appearing twice

I'm trying to setup xVal with an ASP.NET MVC 2 Preview 1 project. I'm basically following the example at http://blog.codeville.net/2009/01/10/xval-a-validation-framework-for-aspnet-mvc/ to the letter (server-side only, so far). I have annotated a BlogPost entity, and here is the Post action: [HttpPost] public ActionResult Index(BlogPo...

I am not sure what I am doing wrong with Xval and remote Validation

Hi I been going through this tutorial and it looks really good. So I went through it and downloaded the sample file. I been playing around with it and I understand how to use it and was able to add my own validation too it. So I decided to add it to my current project I am working on. I was able to get it to compile and run yet whe...

Xval and Comparsion Operators?

Hi I read on the site that version 0.8 of xVal supports "Support for comparison validators (e.g., “PasswordConfirm” must equal “Password”)" Yet I see no tutorial on how to do this. I am trying to compare 2 passwords yet don't even know where to start. Can someone show me how to do this? ...

xVal - Generates Rules Only For The ID Field

I am following this post. Server side validations work as expected. But the clientside validators are only getting generated for the ID field. My Linq2Sql Entity Class has two properties ID & CategoryName and below is my Metadata class [MetadataType(typeof(BookCategoryMetadata))] public partial class BookCategory{} public class BookC...

How can I make xVal work with my extended Html.ValidationImage?

I have extended the ASP.NET MVC Html Helper to include my own ValidationImage that outputs an image rather than the standard tags. Details are shown within the StackOverflow Question: How do I extend Html.ValidationMessage so that I can include an image as the error? I would like this to integrate well with xVal now. What would be th...

Custom ViewModel Class - Not all fields are marked invalid unless a prefix is specified

I have a custom viewmodel inside which I have two fields and one linq2sql entity .. all fields have Validation Attributes attached. Even if all fields are invalid only the fields in the linq2sql class are visually indicated for error and fields in the viewmodel are displayed normally. But the error messages are displayed for all invalid ...

Will xVal work if the attributes are defined on Interfaces?

I'm wondering if anyone knows if xVal will work as expected if I define my system.componentmodel.dataannotations attributes on interfaces that are implemented by my model classes, instead of directly on the concrete model classes. public interface IFoo { [Required] [StringLength(30)] string Name { get; set; } } and then in my ...