Question

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; }
[ValidateNonEmpty]
public int MyInt { get; set; }
}

…would only produce the following:

xVal.AttachValidator(”myClass”, {”Fields”:[{”FieldName”:”MyId”,”FieldRules”:[{”RuleName”:”DataType”,”RuleParameters”:{”Type”:”Integer”}}]}]})

My project works fine with Annotations, I just really wanted to use Castle. Any ideas?

Was it helpful?

Solution

I found the answer in this thread: http://xval.codeplex.com/Thread/View.aspx?ThreadId=50161. Once you follow Simon's advice to rebuild the xVal dll, remember to also copy over the new xVal.RulesProviders.CastleValidator.dll to your solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top