<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Kev'n Roberts : Validation</title><link>http://weblogs.asp.net/kevnroberts/archive/tags/Validation/default.aspx</link><description>Tags: Validation</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>ValidationGroup on the ValidationSummary Control</title><link>http://weblogs.asp.net/kevnroberts/archive/2008/05/12/validationgroup-on-the-validationsummary-control.aspx</link><pubDate>Tue, 13 May 2008 03:44:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6185295</guid><dc:creator>kevnroberts</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/kevnroberts/rsscomments.aspx?PostID=6185295</wfw:commentRss><comments>http://weblogs.asp.net/kevnroberts/archive/2008/05/12/validationgroup-on-the-validationsummary-control.aspx#comments</comments><description>&lt;p&gt;Today I learned an important lesson about the ValidationSummary control. But first, some background.&lt;/p&gt;&lt;p&gt;The bug I was working on was this: the validation summary did not display the validation errors. The page would repost and redisplay, but there was no messaging as to what might be wrong. &lt;/p&gt;&lt;p&gt;The page was set up in a wizard sort of fashion with about three Panel controls that are displayed selectively, depending on which step the user is on. In order to prevent all the validation controls to fire every time a button is clicked, the various validators were assigned to different validation groups, one for each Panel.&amp;nbsp;&lt;/p&gt;&lt;p&gt;It took me about an hour before I &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.validationsummary.validationgroup%28VS.80%29.aspx" title="ValidationSummary.ValidationGroup Property" mce_href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.validationsummary.validationgroup(VS.80).aspx"&gt;discovered this truth&lt;/a&gt;:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;"When you specify a value for the &lt;b&gt;ValidationSummary&lt;/b&gt; property, only 
error messages from the validation controls that are part of the specified group 
are summarized. If you do not set a value for this property, all error messages 
from validation controls on the page that are not assigned to a validation group 
are summarized."&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;The first time I read it, I was in a hurry and didn't catch the very last part: "...&lt;i&gt;that are not assigned to a validation group...&lt;/i&gt;" I guess it is important to read all the documentation.&lt;/p&gt;&lt;p&gt;My bug was that the ValidationSummary did not specify a validation group. According to the docs, that means that only validators that are not assigned a ValidationGroup will show up in the summary control. It was an easy fix (set the validation group when I set which panel to display), but it took me about an hour to figure it out.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6185295" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/kevnroberts/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/kevnroberts/archive/tags/Validation/default.aspx">Validation</category></item></channel></rss>