<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.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>ASP.NET AJAX Control Toolkit</title><link>http://forums.asp.net/1022.aspx</link><description>Here's your place to discuss everything in and about the AJAX Control Toolkit</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: ModalPopup, web user control, and validators</title><link>http://forums.asp.net/thread/3277477.aspx</link><pubDate>Mon, 06 Jul 2009 19:24:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3277477</guid><dc:creator>iqueiroz</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3277477.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3277477</wfw:commentRss><description>&lt;p&gt;Thanks! This does work! I should have thought of it &lt;img src="http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif" alt="Embarassed" title="Embarassed" border="0" /&gt; !!&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: ModalPopup, web user control, and validators</title><link>http://forums.asp.net/thread/3274433.aspx</link><pubDate>Sat, 04 Jul 2009 07:58:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274433</guid><dc:creator>stevew1975</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274433.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3274433</wfw:commentRss><description>&lt;p&gt;I think i know how to solve this.&amp;nbsp; You are saying that the second button on your form runs the validation on the 1st validation control.&lt;/p&gt;&lt;p&gt;To solve this, you need to use validationgroup.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Within the usercontrol in the codebehind add a new property called ValidationGroup which is a string, within this, set all the controls within the web control to have this validation.&lt;/p&gt;&lt;p&gt;i.e.&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="c-sharp"&gt;this is C# so you need to do the vb

public function ValidationGroup
{
   set{
        Textbox1.ValidationGroup = value;
        RequiredFieldValidator1.ValidationGroup = value
        Button1.validationgroup = value
        }

within your html on the form, there will now be a new property called validation group, set it to a different name for each call to your web user control, this will stop it linking.

&amp;lt;uc1:WebUserControl1 id=&amp;quot;WebUserControl1_1&amp;quot; runat=&amp;quot;server&amp;quot; ValidationGroup=&amp;quot;vgroup1&amp;quot;&amp;gt;

and 

&amp;lt;uc1:WebUserControl1 id=&amp;quot;WebUserControl1_2&amp;quot; runat=&amp;quot;server&amp;quot; ValidationGroup=&amp;quot;vgroup2&amp;quot;&amp;gt;            
  &lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>ModalPopup, web user control, and validators</title><link>http://forums.asp.net/thread/3273835.aspx</link><pubDate>Fri, 03 Jul 2009 16:29:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273835</guid><dc:creator>iqueiroz</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273835.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1022&amp;PostID=3273835</wfw:commentRss><description>&lt;p&gt;I have a web user control, and each control within the web user control has some type of validatior. I also have a &amp;quot;Save&amp;quot; button, which fires the validators.&amp;nbsp; &lt;/p&gt;&lt;p&gt;On my web form, I have two modalboxextenders, and the panel for each modalbox has an intance of the web user control above.&lt;/p&gt;&lt;p&gt;Now suppose that I bring up the first modalbox and leave all controls blank. I then click on &amp;quot;Save,&amp;quot; and as expected, the validation fails. So far, so good. The problem is that, the validation summary comes up twice, once for the ModalBox that failed validation, &lt;b&gt;&lt;i&gt;and once for the modalbox which is not visible&lt;/i&gt;&lt;/b&gt;!&lt;/p&gt;&lt;p&gt;I&amp;#39;m not sure whether my description is good enough, so you can try to reproduce the behavior by using the simple example below:&lt;/p&gt;&lt;p&gt;1 - Web User Control:&lt;/p&gt;&lt;pre name="code"&gt;&amp;lt;%@ Control Language=&amp;quot;vb&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; CodeBehind=&amp;quot;WebUserControl1.ascx.vb&amp;quot; Inherits=&amp;quot;WebSiteName.WebUserControl1&amp;quot; %&amp;gt;&lt;br /&gt;&amp;lt;asp:TextBox ID=&amp;quot;TextBox1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;&amp;lt;asp:RequiredFieldValidator ID=&amp;quot;RequiredFieldValidator1&amp;quot; runat=&amp;quot;server&amp;quot; ControlToValidate=&amp;quot;TextBox1&amp;quot; ErrorMessage=&amp;quot;Field is required&amp;quot;&amp;gt;*&amp;lt;/asp:RequiredFieldValidator&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID=&amp;quot;Button1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Save&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;asp:ValidationSummary ID=&amp;quot;ValidationSummary1&amp;quot; runat=&amp;quot;server&amp;quot; ShowMessageBox=&amp;quot;True&amp;quot; ShowSummary=&amp;quot;False&amp;quot; /&amp;gt;&lt;/pre&gt;&lt;p&gt;2 - Web Form:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre name="code" class="xhtml"&gt;&amp;lt;%@ Page Language=&amp;quot;vb&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; CodeBehind=&amp;quot;WebForm1.aspx.vb&amp;quot; Inherits=&amp;quot;WebSiteName.WebForm1&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Register Src=&amp;quot;WebUserControl1.ascx&amp;quot; TagName=&amp;quot;WebUserControl1&amp;quot; TagPrefix=&amp;quot;uc1&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Register Assembly=&amp;quot;AjaxControlToolkit&amp;quot; Namespace=&amp;quot;AjaxControlToolkit&amp;quot; TagPrefix=&amp;quot;cc1&amp;quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; &amp;gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;        &amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;cc1:ModalPopupExtender ID=&amp;quot;ModalPopupExtender1&amp;quot; runat=&amp;quot;server&amp;quot; TargetControlID=&amp;quot;btnModalBox1&amp;quot; OkControlID=&amp;quot;Button1&amp;quot; PopupControlID=&amp;quot;Panel1&amp;quot;&amp;gt; &lt;br /&gt;        &amp;lt;/cc1:ModalPopupExtender&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID=&amp;quot;btnModalBox1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Modal Box1&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Panel ID=&amp;quot;Panel1&amp;quot; runat=&amp;quot;server&amp;quot; Style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;        &lt;br /&gt;            &amp;lt;uc1:WebUserControl1 id=&amp;quot;WebUserControl1_1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;/uc1:WebUserControl1&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;            &amp;lt;asp:Button ID=&amp;quot;Button1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Close Modal 1&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;/asp:Panel&amp;gt;&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;        &amp;lt;cc1:ModalPopupExtender ID=&amp;quot;ModalPopupExtender2&amp;quot; runat=&amp;quot;server&amp;quot; TargetControlID=&amp;quot;btnModalBox2&amp;quot; OkControlID=&amp;quot;Button2&amp;quot; PopupControlID=&amp;quot;Panel2&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;/cc1:ModalPopupExtender&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Button ID=&amp;quot;btnModalBox2&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Modal Box2&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;asp:Panel ID=&amp;quot;Panel2&amp;quot; runat=&amp;quot;server&amp;quot; Style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;            &amp;lt;uc1:WebUserControl1 id=&amp;quot;WebUserControl1_2&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;/uc1:WebUserControl1&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;            &amp;lt;asp:Button ID=&amp;quot;Button2&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Close Modal 2&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;/asp:Panel&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;        &lt;br /&gt;    &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Any ideas? Any help is appreciated.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre name="code" class="vb.net"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>