I have a problem with client side validation.
I want to AssertThat selectedlist != null && selectedlist > 0
It works fine on the server side but fails on the client.
Should I use ArrayParser or do I have to modify that and write my own parser somehow?
[Required] [AssertThat("SelectedTypes != null && IntListLength(SelectedTypes) > 0", ErrorMessage = "Minst en typ måste väljas")] [ValueParser("ArrayParser")] public List<int> SelectedTypes { get; set; }
I did add customtoolchain as well (it was failing on the server side otherwise):
Toolchain.Instance.AddFunction<List<int>, int>("IntListLength", list => list.Count);
Anyone who knows what I should do and can push me into the right direction?
I have a problem with client side validation. I want to AssertThat selectedlist != null && selectedlist > 0 It works fine on the server side but fails on the client. Should I use ArrayParser or do I have to modify that and write my own parser somehow?
[Required] [AssertThat("SelectedTypes != null && IntListLength(SelectedTypes) > 0", ErrorMessage = "Minst en typ måste väljas")] [ValueParser("ArrayParser")] public List<int> SelectedTypes { get; set; }
I did add customtoolchain as well (it was failing on the server side otherwise):
Toolchain.Instance.AddFunction<List<int>, int>("IntListLength", list => list.Count);
Anyone who knows what I should do and can push me into the right direction?
Best regards MJ