I currently have a \[code\]TextBox\[/code\] and \[code\]ListBox\[/code\], each one of them is doing a certain activity to check with the \[code\]MSSQL DB\[/code\] in the \[code\]OnServerValidate\[/code\]. However, the problem is that only the last \[code\]Custom Validator\[/code\] is working and the first never gets validated. See code:\[code\] Company Name: <asp:TextBox ID="CompanyNameTextBox" runat="server" Height="25px" TabIndex="1" Width="285px"></asp:TextBox> <asp:CustomValidator ID="CompanyNameCustomValidator" runat="server" ErrorMessage="Company name already exists" Display="None" ValidateEmptyText="true" ControlToValidate="CompanyNameTextBox" EnableClientScript="true" onservervalidate="CompanyNameCustomValidator_ServerValidate"></asp:CustomValidator> <asp:RequiredFieldValidator ID="CompanyNameRequiredFieldValidator" runat="server" ControlToValidate="CompanyNameTextBox" Display="None" ErrorMessage="The company name field is required!" /> <ajaxToolkit:ValidatorCalloutExtender ID="CompanyNameRequiredFieldValidator_ValidatorCalloutExtender" runat="server" Enabled="True" PopupPosition="Right" TargetControlID="CompanyNameRequiredFieldValidator"> </ajaxToolkit:ValidatorCalloutExtender> <ajaxToolkit:FilteredTextBoxExtender ID="CompanyNameTextBox_FilteredTextBoxExtender" runat="server" Enabled="True" Filtertype="UppercaseLetters, Lowercaseletters, Numbers, Custom" TargetControlID="CompanyNameTextBox" ValidChars="- "> </ajaxToolkit:FilteredTextBoxExtender> Country: <asp:ListBox ID="CountryListBox" runat="server" DataSourceID="CountryDataSource" DataTextField="CountryName" DataValueField="CountryName" Width="285px" SelectionMode="Multiple"></asp:ListBox> <asp:CustomValidator ID="CountryListBoxCustomValidator" ControlToValidate="CountryListBox" runat="server" ErrorMessage="Select at least one and maximum allowed is 6 countries" Display="None" ValidateEmptyText="true" EnableClientScript="true" onservervalidate="CountryListBoxCustomValidator_ServerValidate" > </asp:CustomValidator> <ajaxToolkit:ValidatorCalloutExtender ID="CountryListBoxCustomValidator_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="CountryListBoxCustomValidator" PopupPosition="Right"> </ajaxToolkit:ValidatorCalloutExtender> <asp:RequiredFieldValidator ControlToValidate="CountryListbox" runat="server" ID="CountryListBoxRequiredFieldValidator" Display="None" ErrorMessage="The country field is required" /> <ajaxToolkit:ValidatorCalloutExtender ID="CountryListBoxRequiredFieldValidator_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="CountryListBoxRequiredFieldValidator" PopupPosition="Right"> </ajaxToolkit:ValidatorCalloutExtender> <br /> <ajaxToolkit:ListSearchExtender ID="CountryListBox_ListSearchExtender" runat="server" Enabled="True" TargetControlID="CountryListBox"> </ajaxToolkit:ListSearchExtender>\[/code\]Server Side Code:\[code\]protected void CompanyNameCustomValidator_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = true; companynametxt = CompanyNameTextBox.Text; companynamequery = (from companylist in db.SupplierDBs where companylist.Company == companynametxt select companylist.Company).SingleOrDefault(); // Add company to database if case is true if (companynametxt != companynamequery) { CountryListBoxCustomValidator_ServerValidate(source, args); } else { args.IsValid = false; } } protected void CountryListBoxCustomValidator_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = CountryListBox.Items.Cast<ListItem>().Where(i => i.Selected).Count() <= 6; selectedItemsArray = CountryListBox.GetSelectedIndices(); //gets total selected number of items in listbox selectedItemNumber = CountryListBox.GetSelectedIndices().Length; if (args.IsValid == true)//selecteditem <= 6 && selecteditem != 0) { if (selectedItemNumber <= 6 && selectedItemNumber != 0) { switch (selectedItemNumber) { case 1: countrytxttransfer1 = CountryListBox.Items[selectedItemsArray[0]].ToString(); break; case 2: countrytxttransfer1 = CountryListBox.Items[selectedItemsArray[0]].ToString(); countrytxttransfer2 = CountryListBox.Items[selectedItemsArray[1]].ToString(); break; case 3: countrytxttransfer1 = CountryListBox.Items[selectedItemsArray[0]].ToString(); countrytxttransfer2 = CountryListBox.Items[selectedItemsArray[1]].ToString(); countrytxttransfer3 = CountryListBox.Items[selectedItemsArray[2]].ToString(); break; case 4: countrytxttransfer1 = CountryListBox.Items[selectedItemsArray[0]].ToString(); countrytxttransfer2 = CountryListBox.Items[selectedItemsArray[1]].ToString(); countrytxttransfer3 = CountryListBox.Items[selectedItemsArray[2]].ToString(); countrytxttransfer4 = CountryListBox.Items[selectedItemsArray[3]].ToString(); break; case 5: countrytxttransfer1 = CountryListBox.Items[selectedItemsArray[0]].ToString(); countrytxttransfer2 = CountryListBox.Items[selectedItemsArray[1]].ToString(); countrytxttransfer3 = CountryListBox.Items[selectedItemsArray[2]].ToString(); countrytxttransfer4 = CountryListBox.Items[selectedItemsArray[3]].ToString(); countrytxttransfer5 = CountryListBox.Items[selectedItemsArray[4]].ToString(); break; case 6: countrytxttransfer1 = CountryListBox.Items[selectedItemsArray[0]].ToString(); countrytxttransfer2 = CountryListBox.Items[selectedItemsArray[1]].ToString(); countrytxttransfer3 = CountryListBox.Items[selectedItemsArray[2]].ToString(); countrytxttransfer4 = CountryListBox.Items[selectedItemsArray[3]].ToString(); countrytxttransfer5 = CountryListBox.Items[selectedItemsArray[4]].ToString(); countrytxttransfer6 = CountryListBox.Items[selectedItemsArray[5]].ToString(); break; } InsertData(); //Inserts data into DB } } }\[/code\]The \[code\]CompanyNameTextBox\[/code\] shows the following error when submitting the form, the validation is supposed to popup a \[code\]ValidatorCalloutExtender\[/code\] on the \[code\]Right\[/code\] position but instead it shows this error.\[code\]Violation of UNIQUE KEY constraint 'IX_Company'. Cannot insert duplicate key in object 'dbo.SupplierDB'. The duplicate key value is (IBM).The statement has been terminated.\[/code\] This error is correct but no validation is called out.The \[code\]CountryListBox\[/code\] works as it is intended.