Custom Validation with MVC
See original GitHub issueI am trying to implement custom validation via the ICustomValidation
interface on my DTO but when the controller action is invoked we get this exception:
[AbpValidationException: Method arguments are not valid! See ValidationErrors for details.]
Abp.Runtime.Validation.Interception.MethodInvocationValidator.Validate() in
I realize now this is expected behavior. However, what I want is to be able to display custom validation errors my view. I am using traditional ASP.NET MVC 5 view, not Angular/API setup.
What is the pattern to do this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Custom Validation Attribute In ASP.NET MVC
In this article, we will discuss custom validation with example in ASP.NET MVC. ... Open Visual Studio 2015 or a version of your...
Read more >Model validation in ASP.NET Core MVC and Razor Pages
For scenarios that the built-in validation attributes don't handle, you can create custom validation attributes. Create a class that inherits ...
Read more >ASP.NET MVC: Custom Validation by DataAnnotation
We can validate a model in an action method. The built-in validation attributes are Compare, Range, RegularExpression, Required, StringLength.
Read more >Custom Validation using Data Annotations Attribute in Asp. ...
If you want your own Custom Validation, we need to inherit from ValidationAttribute and create it. Create Asp.Net MVC Application. First, create a...
Read more >Custom Validation Attribute in MVC
Another example of creating a custom validation attribute in ASP.NET MVC. · Right-click on the “Common” folder and add a class file with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rahulbpatel, your action method return what kind of object, IActionResult? If so, try to change to ObjectResult
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.