Questions tagged [foolproof-validation]

MVC Foolproof Validation is a library that complements the Data Annotation validation provided in ASP.NET MVC.

MVC Foolproof Validation is a library that complements the Data Annotation validation provided in ASP.NET MVC.

It's released under the Microsoft Public License.

65 questions
1
vote
1 answer

C# ASP.NET MVC Foolproof RequiredIf - how to set ErrorMessage to be the value of other (string) property?

That's what I'm looking for: [RequiredIf("IsNewClient", true, ErrorMessage =*The value of other (string) property*)] That's would be even better: [RequiredIf("IsNewClient", true, ErrorMessage =*Calling a function and get the value*)]
1
vote
1 answer

ASP.NET MVC: Foolproof Validation not working

In this thread I got the advice to use FoolProof to solve my problem. Thats what Im trying to do right now. But yet, I could not find the reason Foolproof is not working in my project. So I will give you the view and how I included Foolproof there,…
RawMVC
  • 123
  • 1
  • 15
1
vote
2 answers

Conditional Validation ie. Requiring a field only if a certain radio button is checked?

This is more of a pointing in the right direction sort of thing. I'm currently working on a project where a handful of fields will be hidden until a radio button is checked, therefore also not required until then. So tick the specific radio button,…
1
vote
1 answer

using foolproof to make sure end datetime is greater than start datetime

I am using foolproof in a MVC project. I am having trouble where it seems like it is doing a textual comparison to figure out whether the end datetime is greater than the start datetime. Here is the model: public class TestModel { [Required] …
1
vote
0 answers

MVC Attribute, Validate Field based on the values of at least 2 other fileds

Good day, I am using MVC4 and Foolproof validation. I am trying to validate a field based on the values of at least 2 other fields. public int pos1 { get; set; } public int pos2 { get; set; } [RequiredIf("pos1",1,ErrorMessage="some error message"…
1
vote
0 answers

MVC Foolproof - RequiredIf - Greater Than - ENum

I am trying to use the MVC Foolproof Validation toolkit to enforce a field has a value if a earlier status field has reached a certain value... The Status field type is an ENum with defined int values. public enum RequestStatusENum { New = 10, …
Chris Hammond
  • 2,064
  • 5
  • 27
  • 53
1
vote
2 answers

Using Foolproof RequiredIf on multiplecondition

I have a dropdownlist named CustomerType with the the following values Id Name 1 Student 2 Non-Employed 3 Employed 4 SelfEmployed and I have one more property in my viewmodel public string CompanyAddress{ get; set; } My goal…
ksg
  • 3,927
  • 7
  • 51
  • 97
1
vote
1 answer

Complex Custom Validation in Foolproof Validation

I have implemented Complex custom Foolproof validation in my application from this link but sadly its not working.My requirement is simple,I have a input file for uploading an image and there should be a validation if the user chooses to upload file…
ksg
  • 3,927
  • 7
  • 51
  • 97
1
vote
1 answer

Unit Testing of MVC5 Validation with Foolproof - NotImplemented Exception

I am doing unit testing of my validation logic in MVC using the following helper method: public static void ValidateViewModel(Controller controller, object viewModelToValidate) { var validationContext = new ValidationContext(viewModelToValidate,…
Martin Noreke
  • 4,066
  • 22
  • 34
1
vote
1 answer

MVC foolproof validations with mvc4

I have tried to use Requiredif and RequiredifTrue, but both are not working. below is the my code. when I make the value of IsmedicalInsurance to true/false, both other does'nt work. [Required(ErrorMessage="Please update about medical insurance")] …
Muhammad Danish
  • 111
  • 1
  • 6
  • 20
1
vote
1 answer

MVC Foolproof Validation RequiredIfFalse returning error incorrectly

I'm using the MVC Foolproof Validation library to make dependent requirements: public bool IsRequired { get; set; } [RequiredIfTrue("IsRequired", ErrorMessage = "This field is required")] public int RequiredIfTrueSelectID { get; set; } This works…
DLeh
  • 23,806
  • 16
  • 84
  • 128
1
vote
2 answers

Foolproof MVC 5 deppending validation

Grettings my friends... So i have a set of CheckBoxes that i set in my model: [DisplayName("Páginas Consultadas")] public List PaginasConsultadas { get; set; } And i have a fieldtext ("ParaQueUsaEstasPag") that is only required…
1
vote
1 answer

foolproof validation greaterthan error System.NotImplementedException

im using foolproof validation for hours [Required] [Range(typeof(TimeSpan), "00:00:00", "23:59:59")] public Nullable start { get; set; } [Required] [GreaterThan("HoraInicio")] public Nullable end { get; set; } it…
Sergio Ramirez
  • 340
  • 3
  • 16
1
vote
1 answer

"Sys is not defined" error when adding custom validation (MVC Foolproof validation)

I'm trying to add a custom validator using the MVC Foolproof library. However, upon following the instructions here I get the error message "Sys is not defined". I suspect this is because the library was originally written to work with the older…
awj
  • 7,482
  • 10
  • 66
  • 120
1
vote
1 answer

Is it possible to use MVC Foolproof Validation in a domain model project

I am trying to validate two fields based on the URL entered using a RequiredIf data annotation provided by MVC Foolproof Validation, the project is an n-layer web application with business logic, data tier, presentation and unit testing layers. The…
CryoFusion87
  • 796
  • 1
  • 8
  • 28