• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 620
  • Last Modified:

populate validationsummary manually

Hi all,
Is it possible to manually add a line of text to a validation summary control? Something like a listbox maybe where you can dynamically add to it?

Heres the situation if you want more info:
I have a simple form with 2 textboxes and a series of radioboxes. I have the radioboxes linked together using group name.
I dont use a radioButtonList as I want them to enter additonal information for one of the radio buttons when they select it.
The problem is I cannot use a standard required field validtor of this group of radio buttons like I would with a normal radio button list.
So when they click the submit button I currently have to make my own error message appear separately but the validation summary also appears if the user hasnt filled in other fields.

any advice?

1 Solution
Try a custom validator.
CoreSupportAuthor Commented:
Nice one:

    protected void CheckSelected(Object sender, ServerValidateEventArgs args)
        if ((FromMyAddress.Checked == true) || (FromCompanyAddress.Checked))
            args.IsValid = true;
            args.IsValid = false;

                    <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Please select a from option."
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now