Note that there are some explanatory texts on larger screens.

plurals
  1. POCustomValidator with ValidatorCalloutExtender ASP.NET
    text
    copied!<p>I have a Custom Validation Control for validating three controls to check whether they are selected or not. I am also using <code>ValidatorCalloutExtender</code> for customizing the message. Its working correctly with validating single control but when I am using Custom validator I am getting this error</p> <pre><code>Microsoft JScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: id </code></pre> <p>This is my code.</p> <pre><code> &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;ajx:ComboBox runat="server" ID="cmbPaymentType" DropDownStyle="DropDownList" CssClass="drop-down-list" AutoCompleteMode="SuggestAppend"&gt; &lt;asp:ListItem Text="Cash only,No cheques" Value="0"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Cash/Cheques Only" Value="1"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Cash/Temporary credit" Value="2"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="True Credit Only" Value="3"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Bill-To-Bill Credit Only" Value="4"&gt;&lt;/asp:ListItem&gt; &lt;/ajx:ComboBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:ListBox ID="lstBoxCustomerName" runat="server" CssClass="list-item-normal"&gt; &lt;asp:ListItem&gt;ABCKJHKJ&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;ABCKJHKJ&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;ABCKJHKJ&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;ABCKJHKJ&lt;/asp:ListItem&gt; &lt;/asp:ListBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;ajx:ComboBox runat="server" ID="cmbGroupNumber" DropDownStyle="DropDownList" CssClass="drop-down-list" AutoCompleteMode="SuggestAppend"&gt; &lt;/ajx:ComboBox&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:CustomValidator ID="PromotionOptionValidator" runat="server" ErrorMessage="Please select atleast one promotion option." onservervalidate="PromotionOptionValidator_ServerValidate" ControlToValidate="cmbPaymentType&amp;lstBoxCustomerName&amp;cmbGroupNumber"&gt;&lt;/asp:CustomValidator&gt; &lt;ajx:ValidatorCalloutExtender runat="server" ID="PromotionOptionAjxValidator" TargetControlID="PromotionOptionValidator" PopupPosition="TopLeft"&gt; &lt;/ajx:ValidatorCalloutExtender&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>and this is the code behind</p> <pre><code> args.IsValid = true; if (cmbPaymentType.SelectedIndex == -1 &amp;&amp; lstBoxCustomerName.SelectedIndex == -1 &amp;&amp; cmbGroupNumber.SelectedIndex == -1) { args.IsValid = false; } </code></pre> <p>Is it possible to use <code>ValidatorCalloutExtender</code> with CustomValidator. Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload