views:

296

answers:

1

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?

+1  A: 

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.

shanabus