0

In my user control i am having the code as:

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
        <asp:CustomValidator ID="cvOrgTypeGrid" runat="server" Enabled="false" Display="Dynamic" 
            ErrorMessage="Please add rules to get eligible members" >
</asp:CustomValidator>                

In Code behind, I am having a function as:

    public void Validate(bool isOrgType)
    {
        if (!isOrgType) return;
        if (Rules.Any()) return;
        cvOrgTypeGrid.Enabled = true;
        cvOrgTypeGrid.IsValid = false;
    }

I would like to get the error message "Please add rules to get eligible members" in messagebox.

Anybody please help out.

Cheran Shunmugavel
  • 8,319
  • 1
  • 33
  • 40
prabu R
  • 2,099
  • 12
  • 32
  • 41

1 Answers1

0

You can use a Validation Summary Control, check this msdn link

Hassan Mokdad
  • 5,832
  • 18
  • 55
  • 90
  • I have tried it.. Its not working.. Its actually working for RequiredFieldValidator but its not working here. Is there any problem because of updatepanel? – prabu R Apr 23 '13 at 06:49
  • mmm, can you try putting the Validation Summary Control inside the update panel? I am not sure if it will work – Hassan Mokdad Apr 23 '13 at 06:51