Hi Imar
I have a question about validation group behaviour:
I have a form with 2 divs
each div has textbox, button and Validator on the textbox.
each has its own validation group and validation summary.
here is the code:
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Search:
<asp:TextBox Width="90px" ID="txtSearch" runat="server" Font-Size="12px" />
<asp:Button ID="cmdSearch" runat="server" ValidationGroup="SearchInfo" Text="Go"/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Enter Search Text"
ValidationGroup="SearchInfo" Display="None" ControlToValidate="txtSearch" SetFocusOnError="True" />
</div>
<div>
Qty:<asp:TextBox ID="txtQty" Width="35px" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" ValidationGroup="ItemsInfo" Text="Check Qty"/>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtQty"
Type="Integer" Operator="DataTypeCheck" ValidationGroup="ItemsInfo" Display="None"
ErrorMessage="Enter numeric value" SetFocusOnError="True" />
</div>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="SingleParagraph"
ShowMessageBox="true" ShowSummary="false" ValidationGroup="SearchInfo" />
<asp:ValidationSummary ID="ValidationSummary2" runat="server" DisplayMode="BulletList"
ShowMessageBox="true" ShowSummary="false" ValidationGroup="ItemsInfo" />
</form>
</body>
</html>
every thing work ok, but when the focus is on the txtQty texbox and I press "Enter" Key on the keyboard the message of the search text is poping?
why is that and how it can be avoided?
TIA
BARAK