Questions tagged [castle-validators]

Castle validator component is an open source validation framework that uses property attribute to specify validation rules on class.

11 questions
2
votes
2 answers

MVC Validation Error Messages not hardcoded in Attributes

I have a requirement that the validation error messages that are passed to my view come from the database. I want to use data annotation on my model but the error message key in validation attributes can only be a string or a constant. I'm open to…
detroitpro
  • 3,853
  • 4
  • 35
  • 64
1
vote
1 answer

How to build a custom Validator for Castle Validation on client-side?

I'm using castle validation and I'd like to know why my validator is not working : [Serializable] public class PositiveIntegerValidator : AbstractValidator { public override bool IsValid(object instance, object fieldValue) { …
remi bourgarel
  • 9,231
  • 4
  • 40
  • 73
1
vote
0 answers

Can Castle Validators work with DataAnnotations attributes?

Is there a way of making DataAnnotations attributes such as Required to work with Castle Validators? I know Castle has its own attributes - but I am wanting to use the same attribute for the view and business logic. So I want the attributes to be…
Dan
  • 29,100
  • 43
  • 148
  • 207
1
vote
1 answer

Is there a way to disable Castle Active Record validation for an nhibernate session / active record scope

Is there a way to disable Active Record validation for an nhibernate session / active record scope? I have a scenario whereby we are performing deletion of a large number of items - and in some cases customers have data in their database that will…
Bittercoder
  • 11,753
  • 10
  • 58
  • 76
1
vote
2 answers

button and validators

I have a Table with two textboxes. Every textbox has a required validator to make the user insert data in the textbox. I also have a Login table to confirm user privilages. When I submit the button of login, the validators from the first table…
Myworld
  • 1,861
  • 16
  • 45
  • 75
1
vote
2 answers

C# Custom Attributes accessing database

I have a custom attribute that accesses the database with nhiberate. The attribute actually inherits from Castle's AbstractValidationAttribute and is used to validate properties against regular expressions. Problem is, these regular expressions…
robinbetts
  • 104
  • 1
  • 10
1
vote
1 answer

What techniques are being used to pass MVC ModelState validation errors back to the client when using JsonResult?

I'm sort of thinking out loud here, so let me know if I need to clarify... on ajax heavy sites, when using JsonResult to pass information back to the client, what techniques, patterns, best practices are being used to pass ModelState validation…
Jon Erickson
  • 112,242
  • 44
  • 136
  • 174
1
vote
1 answer

For someone with experience using xVal, is it worth it to learn and use castle validators over the built in data annotations?

What does the castle validators offer me over standard data annotations? I am a first-time user of xVal, data annotations and castle validators so there will be a learning curve regardless of which I decide. Is it worth it to just start using casle…
Jon Erickson
  • 112,242
  • 44
  • 136
  • 174
0
votes
0 answers

How to use CastleValidator with clientside jquery validation plugin in asp.net mvc?

How to use CastleValidator with clientside jquery validation plugin together in asp.net mvc?
VoimiX
  • 1,180
  • 3
  • 16
  • 31
0
votes
1 answer

Castle Active Record - Validation and Relationships

I have two models: foo and bar. Foo has a bar object. Foo and bar have validation rules. If I call Foo.isValid() it doesn't validate bar too. I need to validate bar with isValid. How does Castle Active Record Validation work for relationship? Do you…
0
votes
1 answer

Castle Validators how to Validate Is Lesser/Greater Than Or Equal

I see the ValidateIsLesser and ValidateIsGreater attributes. But what if I want to do a ValidateIsLesserOrEqual and/or ValidateIsGreaterOrEqual. Do I just need to write these custom attributes or is there pre-built capabilities for this that I am…
Jon Erickson
  • 112,242
  • 44
  • 136
  • 174