Solved

populate validationsummary manually

Posted on 2006-11-02
2
596 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now