<p>I am building a public website using ASP.NET, as part of the deliverable I need to do an Admin Site for data entry of the stuff shown in the public site, I was wondering what techniques or procedures are people using to validate entries using ASP.NET MVC.</p>

[{'answer_id': 25606, 'author': 'Daniel Pollard', 'author_id': 2758, 'author_profile': 'https://Stackoverflow.com/users/2758', 'pm_score': 6, 'selected': True, 'text': '<p>Take a look at the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="noreferrer">JQuery Validation plugin</a> this plugin is amazing,it\'s clean to implement and has all the features you could ever need, including remote validation via AJAX.</p>\n\n<p>Also a sample MVC controller method can be found <a href="http://httpcode.com/blogs/PermaLink,guid,f8970f20-90d1-4af6-b2da-0285f1963b14.aspx" rel="noreferrer">here</a> which basically uses the JsonResult action type like:</p>\n\n<pre><code>public JsonResult CheckUserName(string username)\n{\n    return Json(CheckValidUsername(username));\n}\n</code></pre>\n'}, {'answer_id': 256975, 'author': 'Emad', 'author_id': 18132, 'author_profile': 'https://Stackoverflow.com/users/18132', 'pm_score': 1, 'selected': False, 'text': '<p>My favorite way it perform both client and server validation using model-based attributes.  I wrote a short post about this and released the source code as well, that will basically allow you to create a class like this</p>\n\n<pre><code>\n\nclass User {\n\n    [Required]\n    public string Name{get;set;}\n\n    [Email][Required]\n    public string Email {get;set;}\n}\n\n</code></pre>\n\n<p>And the appropriate javascript code will be generated to perform client validation as well as server-side validation runner will be validate your submitted form.</p>\n\n<p>Read the post over <a href="http://www.emadibrahim.com/2008/09/08/client-server-side-validation-in-aspnet-mvc/" rel="nofollow noreferrer">here</a></p>\n'}, {'answer_id': 1023755, 'author': 'Adrian Grigore', 'author_id': 59301, 'author_profile': 'https://Stackoverflow.com/users/59301', 'pm_score': 3, 'selected': False, 'text': '<p>IMO using xVal with jQuery and DataAnnotationsModelBinder is the best combination. </p>\n\n<p>Sometimes however, there are validation rules which cannot be checked entirely on the client side, so you need to use remote client-side validation. </p>\n\n<p>I figured out way to generically implement remote client-side validation with xVal / jQuery.validate so that</p>\n\n<ul>\n<li>Validation rules remain solely in your ASP.NET MVC model</li>\n<li>You write each validation rule just once, and only in easily testable C# code. There is no JavaScript or other client-side counterpart .</li>\n<li>There is no need to branch or otherwise modify xVal or jquery.validate</li>\n<li>All you have to do for each new remote form validation rule is to derive from the base class shown in this article.</li>\n</ul>\n\n<p>I wrote a <a href="https://devermind.wordpress.com/2009/06/21/asp-net-mvc-tip-3-how-to-cover-all-your-client-side-form-validation-needs-without-writing-any-javascript-part1/" rel="nofollow noreferrer">blog article</a> on this describing all the details. </p>\n'}]
['https://Stackoverflow.com/questions/16747', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1549/']