Solved

populate validationsummary manually

Posted on 2006-11-02
2
598 Views
Last Modified: 2008-01-16
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?
Dave

0
Comment
Question by:CoreSupport
2 Comments
 
LVL 11

Accepted Solution

by:
ethoths earned 250 total points
ID: 17858172
Try a custom validator.
0
 

Author Comment

by:CoreSupport
ID: 17858528
Nice one:

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

                    <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Please select a from option."
                        OnServerValidate="CheckSelected">*</asp:CustomValidator>
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question