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 ...
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?
...
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...
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:...
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; }
}
...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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?
...
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...
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...
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 ...
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 ...