Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6740847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:39:19+00:00 2026-05-26T11:39:19+00:00

<asp:ListBox ID=lst_newGrpMembers DataValueField=Name SelectionMode=Multiple Width=120px ToolTip=Press ctrl to select multiple users runat=server> </asp:ListBox> <asp:RequiredFieldValidator

  • 0
<asp:ListBox ID="lst_newGrpMembers" 
             DataValueField="Name" 
             SelectionMode="Multiple"
             Width="120px" 
             ToolTip="Press ctrl to select multiple users" 
             runat="server">
</asp:ListBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" 
                            runat="server" 
                            ControlToValidate="lst_newGrpMembers"
                            ErrorMessage="Atleast one member required" 
                            CssClass="Error" 
                            Text="*Atleast one member required"
                            ValidationGroup="CreateGroupValidationGroup">
</asp:RequiredFieldValidator>

I have a required field validator for a list box, it validates and shows error where there is no entry in the list box, but when I add item to the list box, it still shows error. When I select the list box item which I added and click submit it works fine. How to validate the list box.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:39:20+00:00Added an answer on May 26, 2026 at 11:39 am

    On the RequiredFieldValidator, try setting InitialValue to empty string:

    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"          
        InitialValue=""
        ControlToValidate="lst_newGrpMembers" 
        ErrorMessage="Atleast one member required"  
        CssClass="Error"  
        Text="*Atleast one member required" 
        ValidationGroup="CreateGroupValidationGroup"> 
    </asp:RequiredFieldValidator> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list box in my aspx page: <asp:ListBox ID=lstTreatmentProvider runat=server SelectionMode=Multiple Width=175px
i have a list: <asp:ListBox ID=lstProblems runat=server SelectionMode=Multiple></asp:ListBox> and i am populating it this
I have the following listbox on aspx page. <asp:ListBox runat=server ID=lbA Visible=true SelectionMode=Multiple DataTextField=A_FACTOR
I can't find a way to select multiple items in an ASP.NET ListBox in
Here is a part of my code: <asp:ListBox ID=lbRD runat=server DataSourceID=RDSqlDataSource onchange=JSFillDetail(); DataTextField=Описание DataValueField=ID
I have an ASP ListBox that has the SelectionMode set to "Multiple". Is there
My ListBox on aspx page is as follows:- <asp:ListBox ID=ddlItems runat=server Style=padding: 2px; width:
<asp:ListBox ID=listbox_Userrole runat=server DataSourceID=SK DataTextField=RoleName DataValueField=RoleName ></asp:ListBox> <asp:SqlDataSource ID=SurelyKnown runat=server ConnectionString=<%$ ConnectionStrings:ConnectionString %> ProviderName=<%$
I have a list box control: <asp:ListBox runat=server id=lbox autoPostBack=true /> The code behind
I have a multi-select <asp:listbox> and a button. I want to disable the button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.