<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Custom Validation</title><link>http://www.asp.net</link><pubDate>Mon, 19 Nov 2012 01:49:10 GMT</pubDate><generator>umbraco</generator><description>Comments for Custom Validation</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/43066" rel="self" type="application/rss+xml" /><item><title>Comment Posted by antony_scott</title><link>http://www.asp.net/web-api/videos/getting-started/custom-validation</link><pubDate>Thu, 23 Feb 2012 08:25:59 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000014921</guid><description><![CDATA[ <p>Will the errors render in xml if the client&#39;s accept header is set that way?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/antony_scott.jpg?forceidenticon=false&amp;dt=635047040400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by apocolpse</title><link>http://www.asp.net/web-api/videos/getting-started/custom-validation</link><pubDate>Tue, 06 Mar 2012 14:34:07 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015034</guid><description><![CDATA[ <p>How can I put into the validation to use libraries like FluentValidation ?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/apocolpse.jpg?forceidenticon=false&amp;dt=635047040400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by redd</title><link>http://www.asp.net/web-api/videos/getting-started/custom-validation</link><pubDate>Sun, 06 May 2012 18:30:54 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015460</guid><description><![CDATA[ <p>Very helpful, and easily solved my own needs. The video would be more helpful if the code in the video could be downloaded, or were included for copy/paste in the notes here.</p><p></p><p>I found pretty the same code here though: <a rel="nofollow" href="http://stephenwalther.com/blog/archive/2012/03/05/introduction-to-the-asp-net-web-api.aspx" target="_blank">stephenwalther.com/</a></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/redd.jpg?forceidenticon=false&amp;dt=635047040400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Dan Danneberg</title><link>http://www.asp.net/web-api/videos/getting-started/custom-validation</link><pubDate>Wed, 27 Jun 2012 05:05:49 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015864</guid><description><![CDATA[ <p>Nice video. And the code can be downloaded now the link provided below the video window.</p><p></p><p>My problem started deploying this application to IIS and using it from another PC. The IIS in this case changes all &quot;bad&quot; HTTP results for it&#39;s own HTTP standard error page. The solution was: changing the &lt;httpErrors errorMode=&quot;Costume&quot;&gt; to &lt;&quot;Detailed&quot;&gt; but this affects http pages to and anybody could see the &quot;stacktrace&quot; of your application. So you need &quot;customized&quot; Exception handling and error page generation within your website.</p><p></p><p>Is there a best practice / example / blueprint how to do this right?</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Dan%20Danneberg.jpg?forceidenticon=false&amp;dt=635047040400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by guogangj</title><link>http://www.asp.net/web-api/videos/getting-started/custom-validation</link><pubDate>Tue, 25 Sep 2012 21:30:33 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016515</guid><description><![CDATA[ <p>I have a question.</p><p>I modified the Contact model like that:</p><p>public class Comment : IValidatableObject</p><p>{</p><p>        //...</p><p></p><p>        public System.Collections.Generic.IEnumerable&lt;ValidationResult&gt; Validate(ValidationContext validationContext)</p><p>        {</p><p>            yield return new ValidationResult(&quot;Test error message.&quot;);</p><p>        }</p><p>    }</p><p></p><p>Then I got a Javascript error. Would you please help me?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/guogangj.jpg?forceidenticon=false&amp;dt=635047040400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by virshu</title><link>http://www.asp.net/web-api/videos/getting-started/custom-validation</link><pubDate>Mon, 19 Nov 2012 01:49:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016827</guid><description><![CDATA[ <p>Web API has undergone significant changes, so this video is now somewhat obsolete. Most changes can be understood from other articles and sample code - in fact, I found it to be a great exercise to make it work. However, with the changes in what comes to the client in case of bad request (ModelState instead of dynamic errors object) and the changes in the validator ($.validator.unobtrusive.revalidate no longer valid) - I can&#39;t figure out how to make it work. Any pointers would be great!</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/virshu.jpg?forceidenticon=false&amp;dt=635047040400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>