Validation in a MS MVC application, revisited (mattias-jakobsson.net)

submitted by JakobssonJakobsson(485) 2 years, 8 months ago

A while ago I posted a approach to validating you´r model and one to add captcha validation in a MS MVC application. You can find those posts here: Mvc, validate controller action input and Asp.net mvc captcha validation made easy. They both use a attribute approach to declare what to validate and how. I then find the attributes in a base controller and validate, then I put any error in the modelstate of the controller. Later, after thinking a little bit about this, I figured that I might just as well use action filters. Then I will not have to inherit from my BaseController everywhere I want to use this approach. So I sat down and rebuild it.

add a comment |category: |Views: 9

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story