<p>I'm using an older version of ASP.NET AJAX due to runtime limitations, Placing a ASP.NET Validator inside of an update panel does not work. Is there a trick to make these work, or do I need to use the ValidatorCallOut control that comes with the AJAX toolkit?</p>

[{'answer_id': 32929, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 2, 'selected': False, 'text': '<p>@jmein</p>\n\n<p>Actually the problem is that the Validator client script\'s don\'t work when placed inside of an updatePanel (UpdatePanels refresh using .innerHTML, which adds the script nodes as text nodes, not script nodes, so the browser does not run them).</p>\n\n<p>The fix was a patch released by microsoft that fixes this issue. I found it with the help of Google.</p>\n\n<p><a href="http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx</a></p>\n'}, {'answer_id': 32996, 'author': 'Euro Micelli', 'author_id': 2230, 'author_profile': 'https://Stackoverflow.com/users/2230', 'pm_score': 5, 'selected': True, 'text': '<p>I suspect you are running the original release (RTM) of .NET 2.0.</p>\n\n<p>Until early 2007 validator controls were not compatible with UpdatePanels. This was resolved with the SP1 of the .NET Framework.</p>\n\n<p>The source of the problem is that UpdatePanel can detect markup changes in your page, but it has no way to track scripts correctly. Validators rely heavily on scripts. During a partial postback, the scripts are either blown away, not updated, or not run when they are meant to.</p>\n\n<p>In early betas, MS had the UpdatePanel try to <em>guess</em> what scripts needed to be re-rendered or run. It didn\'t work very well, and they had to take it out.</p>\n\n<p>To get around the immediate problem, Microsoft released a patched version of the validator classes in a new DLL called Validators.DLL, and gave instructions on how to tell ASP.NET to use those classes instead of the real ones. If you Google for that DLL name, you should find more information. See also <a href="http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx" rel="noreferrer">This blog post</a>.</p>\n\n<p>This was a stop-gag measure and you should <strike>not use it</strike> <em>avoid it if possible</em>.</p>\n\n<p>The real solution to the problem came shortly after, in .NET 2.0 SP1. Microsoft introduced a new mechanism to register scripts in SP1, and changed the real validator classes to use that mechanism instead of the older one.</p>\n\n<p>Let me give you some details on the changes:</p>\n\n<p>Traditionally, you were supposed to register scripts via Page methods such as Page.RegisterStartupScript() and Page.RegisterClientScriptBlock(). The problem is that these methods were not designed for extensibility and UpdatePanel had no way to monitor those calls.</p>\n\n<p>In SP1 there is a new property object on the page called Page.ClientScripts. This object has methods to register scripts that are equivalent (and in some ways better) to the original ones. Also, UpdatePanel can monitor these calls, so that it rerenders or calls the methods when appropriate. The older RegisterStartupScript(), etc. methods have been deprecated. They still work, but not inside an UpdatePanel.</p>\n\n<p>There is no reason (other than politics, I suppose) to not update your installations to .NET 2.0 SP1. Service Packs carry important fixes.</p>\n\n<p>Good luck.</p>\n'}, {'answer_id': 33026, 'author': 'Euro Micelli', 'author_id': 2230, 'author_profile': 'https://Stackoverflow.com/users/2230', 'pm_score': 2, 'selected': False, 'text': '<blockquote>\n  <p>@Jonathan Holland:  What is wrong with using Validators.dll?</p>\n</blockquote>\n\n<p>Since they replace the original classes, you are quietly bypassing any bug and security fixes, enhancements, etc. that Microsoft might release in the future (or might have already released). Unless you look carefully at the web.config, you might never notice that you are skipping patches.</p>\n\n<p>Of course, you have to evaluate each situation. If you are absolutely stuck using .NET 2.0 RTM, then Validators.dll is better than nothing.</p>\n'}, {'answer_id': 107824, 'author': 'Aaron Powell', 'author_id': 11388, 'author_profile': 'https://Stackoverflow.com/users/11388', 'pm_score': -1, 'selected': False, 'text': '<p>If for what ever reason you are unable to use the udpated version of the ASP.NET validator controls is actually very easy to validate a validation group yourself, all you need to do is call </p>\n\n<pre><code>Page_ClientValidate("validationGroupName");\n</code></pre>\n\n<p>Then you can use the PageRequestManager execute the validation as you need.</p>\n\n<p>Definately using the updated validation controls is the way to go, but I\'m quite partial to JavaScript ;)</p>\n'}]
['https://Stackoverflow.com/questions/32814', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1965/']