Solved

populate validationsummary manually

Posted on 2006-11-02
2
601 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 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