New ASP.NET MVC Validation Tutorials Posted at www.ASP.net/MVC

I’ve received a lot of email about the best way to handle validation in an ASP.NET MVC application. We posted three new tutorials on validation at the http://www.ASP.net/mvc website. Here is the list:

 

  • Performing Simple Validation – Learn how to perform validation in an ASP.NET MVC application. In this tutorial, Stephen Walther introduces you to model state and the validation HTML helpers.

 

  • Validating with the IDataErrorInfo Interface – Stephen Walther shows you how to display custom validation error messages by implementing the IDataErrorInfo interface in a model class.

 

  • Validating with a Service Layer – Learn how to move your validation logic out of your controller actions and into a separate service layer. In this tutorial, Stephen Walther explains how you can maintain a sharp separation of concerns by isolating your service layer from your controller layer.

 

I don’t want to suggest that these are the only methods of performing validation in an ASP.NET MVC application. For example, an alternative that is not discussed in these tutorials is the Microsoft Enterprise Library Validation Application Block. In future tutorials, I’ll discuss other methods of performing validation.

Here’s the direct link to the MVC Validation tutorial category:

ASP.NET MVC Validation

Discussion

  1. Bill says:

    Thanks for posting these. One little problem… the formatting in the second tutorial (Validating with the IDataErrorInfo Interface) is borked. It appears there’s a missing quote on the pre tags for code samples. Makes it unreadable.

  2. Will Green says:

    I second @Bill’s comment. Article is totally unreadable due to an unclosed attribute value (missing close quotation mark) for the first code sample. Renders everything beyond it unreadable. Disappointing, as this is the very topic I’m struggling with on my app right now.

  3. Stephen Walther says:

    @Will, @Bill — Thanks for pointing out the formatting issue — it’s been fixed.

  4. @bill and @Will – it look ok for me. I dont seem to be having problem to view the article.

  5. Hi.. thanks for this information dan this link..
    great sharing..

  6. Nice sharing man. That link are so useful to me.

  7. Gill Bates says:

    Hi Stephen, I have some spermlinks I would like to share with you. It’s the story of how my colleague got the MVC HtmlHelper stuck up his pooper while trying to make a nested loop in the back of his head. I know this will be of great value for you for further editions of ASP.NET MVC.

  8. Phillip says:

    In the simple demo you mention needing to add resource strings to customize the prebinding error messages. Can you show an example of how to do this?

  9. Rock says:

    Is there any easy way to do validation for properties such as associations in Entity framework? Since there is no OnChanging for such properties… to use IDataErrorInfo?

  10. thanks for the tutorial listings. I should bookmark

  11. Yes.. jackson, i agree with you..
    very informative tutorials..
    Great sharing here..

    Cheers,
    inventory management software

  12. Melayu Boleh says:

    Hey..
    great tutorials your posting here..
    Thanks for sharing.
    i like..

  13. Yes.. jackson, i agree with you..
    very informative tutorials..
    Great sharing here..

  14. tom says:

    You may also use the Validator Toolkit for ASP.NET MVC on codeplex.com: http://mvcvalidatortoolkit.codeplex.com

  15. Graet tutorials and links. Thanks for sharing them.

  16. MvcCms-Jon says:

    Thanks for all the great input Stephen. I have tried to use a lot of the architecture you have outlined on MvcCms. We are nearing out first release and would appreciate any feedback on how we might improve the initial architecture. The source is available on codeplex at mvccms.codeplex.com

  17. hello, this is my first time i visit here. I found so many interesting in your blog especially on how to determine the topic. keep up the good work.

  18. Really very nice tutorials Stephen. Thanks for sharing.

  19. Max GlipMax says:

    May be it’s the first time for me visiting your blog, but I know it contains so many useful things here. thanks a lot.

  20. Blue Eyes says:

    great work at this post… i like it thanks!

  21. Be Creative says:

    Yes.. jackson, i agree with you..
    very informative tutorials..
    Great sharing here..

  22. Thanks for these 3 links, Stephen i m waiting for the other one.

  23. Nice Post! Really validations are very important in any applications. Thanks for sharing useful information.

  24. ty for the 3 tutorials links. It gives options to do yourself or it provides some free downloads form what I can see, thank you for sharing this.

  25. seo india says:

    Hi.. thanks for this information.

  26. seo says:

    thank you for sharing this.

  27. seo says:

    Thanks for these links.

  28. seotips says:

    Useful things here. thanks a lot.

  29. linkexchnage says:

    Great sharing here.

  30. seo-tips says:

    Great links. Thanks for sharing them.

  31. sem-tips says:

    Great work at this post.

  32. seo-tips says:

    Very informative tutorials.

  33. bookmarking says:

    Great keep up the good work.

  34. blog-seo says:

    Very important applications.

  35. key-phrases says:

    Thanks for posting these.

  36. semantics says:

    Thank you for sharing these.

  37. googleseo says:

    Many useful things here. thanks a lot.

  38. adsense says:

    Very nice tutorials Stephen.

  39. seo-sem-tips says:

    Stephen Great work.

  40. seo-benefits says:

    Great work at this post

  41. That link are so useful to me.

  42. education says:

    Very informative tutorials.

  43. Very good tutorials.. great work..

  44. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

  45. melayu boleh says:

    Very informative tutorial.

  46. This is exactly what i was looking for.

  47. Considering that your blog is really helpful. thanks for the information

  48. Its always good to learn tips like you share for blog posting. As I just started posting comments for blog and facing problem of lots of rejections. I think your suggestion would be helpful for me. I will let you know if its work for me too.
    Thanks and keep post such a informative blogs.

  49. I’ve been looking for some tips about this niche. I just found this on Google. Thank you for sharing this helpful tips..

  50. moratmarit says:

    Thank you for sharing this articles. Very interesting.

  51. SEO Services says:

    Nice article.The code works fine and is a good starting point for me making a
    custom module.Thanks for the module..

  52. Gambar Lucah says:

    Thanks for the code which created a great module.

  53. nancy says:

    useful code. it helps me. thanks

  54. thanks for sharing. This article is useful for me..

  55. fast cars says:

    Useful information

  56. gtr Thanks you for sharing.

  57. thanks for this topic

  58. Hi,

    Thanks for posting this tutorial, as it helps to learn alot of new things, Good starting who want to begin with custom module.

    Keep Sharing,and Keep going on.

  59. tong kosong says:

    thanks for this nice info, it’s so useful for me.

  60. Looking forward for more such stuff. Loved your style of providing the information and the nature of the content.

  61. thanks for this nice info, it’s so useful for me.

  62. clients get too involved in the small details of a design. Honestly, does it really matter if I put a red box on top or on the bottom of a page? If it’s at the top, then I already made a concious decision about why it’s fine the way it is. I understand that design is subjective, but communicating to a client that they can trust our expertise is very difficult.

  63. Looking forward for more such stuff. Loved your style of providing the information and the nature of the content.

  64. Online GED says:

    if I put a red box on top or on the bottom of a page? If it’s at the top, then I already made a concious decision about why it’s fine the way it is. I understand that design is subjective, but communicating to a client that they can trust our expertise is very difficult.

  65. then I already made a concious decision about why it’s fine the way it is. I understand that design is subjective, but communicating to a client that they can trust our expertise is very difficult.

  66. Awek Seksi says:

    Thanks for making things much simpler. I knew there was an easy way out.

  67. Melayu Boleh says:

    Thank goodness i found your article.

  68. UK printing says:

    Nice information much helpful article thanks for sharing this great information on ASP.NET MVC Validation.

  69. ME degree says:

    Nice information much helpful article thanks for sharing this great information on ASP.NET MVC Validation. PhD computer science | english diploma

  70. Thanks for this nice info, it’s so useful for me.

  71. anks for this nice info, it’s so useful for me.

  72. Thanks for this nice info, it’s so useful for me. توبيكات

  73. thanks for the validation tutorials.

  74. quotes says:

    Wow, that was heart provoking article presented by you sir
    thanks for sharing
    regards

  75. Interesting post. thanks for the time and effort

  76. online games says:

    Thanks for this nice info

  77. Thanks for sharing..
    great posts

  78. Oes Tsetnoc says:

    what a great tutorial, it’s so useful for me. thanks.

  79. games says:

    Great tutorial!!!

  80. Blog SEO says:

    Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful and beneficial to your readers.

  81. Its always good to learn tips like you share for blog posting. As I just started posting comments for blog and facing problem of lots of rejections. I think your suggestion would be helpful for me. I will let you know if its work for me too.
    Thanks and keep post such a informative blogs.

  82. Oes Tsetnoc says:

    Very nice tutorials Stephen. keep post

  83. Oes Tsetnoc says:

    great info, this information useful for me, thanks regards Oes Tsetnoc wongsableng visit my article here Oes Tsetnoc , another here Oes Tsetnoc , and here Oes Tsetnoc thanks
    don’t forget visit my another article Kenali dan Kunjungi Objek Wisata di Pandeglang
    | Mengembalikan Jati Diri Bangsa | Bisnis Pulsa Eranet | Kenali dan Kunjungi Objek Wisata di Pandeglang
    | Mengembalikan Jati Diri Bangsa

  84. great info, this information useful for me, thanks regards Oes Tsetnoc wongsableng visit my article here Oes Tsetnoc , another here Oes Tsetnoc , and here Oes Tsetnoc thanks
    don’t forget visit my another article Kenali dan Kunjungi Objek Wisata di Pandeglang | Mengembalikan Jati Diri Bangsa | Bisnis Pulsa Eranet | Kenali dan Kunjungi Objek Wisata di Pandeglang
    | Mengembalikan Jati Diri Bangsa

  85. Thanks for the simple and easy to follow tutorial on how to perform validation in an ASP.NET MVC application, it helped me a lot thanks.

  86. 322 It’s lucky to know this, if it is really true. Companies tend not to realize when they create security holes from day-to-day operation.

  87. nice article, this information useful for me, thanks regards Oes Tsetnoc wongsableng visit my article here Oes Tsetnoc , another here Oes Tsetnoc , and here Oes Tsetnoc thanks
    don’t forget visit my another article Kenali dan Kunjungi Objek Wisata di Pandeglang
    | Mengembalikan Jati Diri Bangsa | Bisnis Pulsa Eranet | Kenali dan Kunjungi Objek Wisata di Pandeglang
    | Mengembalikan Jati Diri Bangsa

  88. amazing information, this information useful for me, thanks regards Oes Tsetnoc wongsableng visit my article here Oes Tsetnoc , another here Oes Tsetnoc , and here Oes Tsetnoc thanks
    don’t forget visit my another article Kenali dan Kunjungi Objek Wisata di Pandeglang
    | Mengembalikan Jati Diri Bangsa | Bisnis Pulsa Eranet | Kenali dan Kunjungi Objek Wisata di Pandeglang
    | Mengembalikan Jati Diri Bangsa

  89. I haven’t any word to appreciate this post…..Really i am impressed from this post….the person who create this post it was a great human..thanks for shared this with us.i found this informative and interesting blog so i think so its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.In fact your creative writing abilities has inspired me.Really the blogging is spreading its wings rapidly. Your write up is fine example of it

  90. I havent any word to appreciate this post…..Really i am impressed from this post….the person who create this post it was a great human..thanks for shared this with us.

  91. thanks..your blog is full of useful knowledge.. 😀

  92. May be it’s the first time for me visiting your blog, but I know it contains so many useful things here. thanks a lot.