Link to home
Start Free TrialLog in
Avatar of treehouse2008
treehouse2008

asked on

ValidationSummary does not show error message

I used the following code to try ValidationSummary. But ValidationSummary  does not show the error message.  Please tell me what I missed. Thanks.

<asp:TextBox ID="txtRequired" ValidationGroup="aaa" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequired"  Display="Static" ControlToValidate="txtRequired" Text="*" ErrorMessage="Required" runat="server"></asp:RequiredFieldValidator>

<asp:ValidationSummary ID="val" HeaderText="Error:" Font-Names="verdana"
                Font-Size="12" DisplayMode="BulletList"  Enabled="true"  ShowSummary="true"  ValidationGroup="aaa" runat="server" />

Avatar of guru_sami
guru_sami
Flag of United States of America image

because For ValidationSummary and TextBox controls you have   ValidationGroup="aaa"
but not for RequiredFieldValidatorControl
So set  ValidationGroup="aaa" for valRequired as well
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of treehouse2008
treehouse2008

ASKER

Thanks.
I have another related question. I have start a new question for it. Could you please help me with it. Thanks.
https://www.experts-exchange.com/questions/24422405/ValidationSummary-does-not-show-error-message-from-CustomValidator.html