0

Guys I have a question here. I write a custom validation and then my validation summary doesnt show up. Any suggestion..

I just use onservervalidation,without client validation. is that possible to show up the message?

protected  void ServerValidation(object source, ServerValidateEventArgs args)
        {
           
                if (args.Value.ToString().Equals("Select"))
                {
                    args.IsValid = false;
                }
                else
                {
                    args.IsValid = true;
                }
          
        }
<asp:CustomValidator ID="CustomValidator1" 
        runat="server" 
        ErrorMessage="Please Select One " 
        OnServerValidate="ServerValidation"
        ValidateEmptyText="True" 
        ControlToValidate="Purpose" 
        ForeColor="Red" EnableClientScript="False" Display="None" 
            ValidationGroup="vgSetUp">*</asp:CustomValidator>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red"
            HeaderText="Submission failed: Please insert the following fields:" 
            ValidationGroup="vgSetUp" />

Advise is needed.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Stefan_Lam88
0

Problem solved...It just show up after 2nd time validation...wonder can show all in 1 time validation summary?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.