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 8098215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:00:48+00:00 2026-06-05T22:00:48+00:00

<asp:DropDownList id=Code1 runat=server OnLoad=GetCode1 ValidationGroup=ValidateGroup/> <asp:RequiredFieldValidator ID=Code1_RequiredValidator runat=server ErrorMessage=Please select a value! ControlToValidate=Code1 ValidationGroup=ValidateGroup

  • 0
<asp:DropDownList id="Code1" runat="server" 
    OnLoad="GetCode1" ValidationGroup="ValidateGroup"/>    
 <asp:RequiredFieldValidator ID="Code1_RequiredValidator" runat="server" 
       ErrorMessage="Please select a value!"   ControlToValidate="Code1" 
       ValidationGroup="ValidateGroup" InitialValue="Select Code1!">
 </asp:RequiredFieldValidator>

the drop down is populated in the code behind as shown below:

protected void GetCode1(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ISROManagement sroMgmt = ObjectFactory.CreateSROManagement();
                List<string> code1List = QuerydBForCodes();
                Code1.DataSource = codeList;
                Code1.DataBind();
                Code1.Items.Insert(0, "Make a selection."); //Added to be shown as the default value:
            }
        }

When I submit the modal pop up extender -with the default value at index 0 i.e. Make a Selection – I don’t see the ErrorMessage=”Please make a selection!” printed next to the drop down! So the validation does not happen.

Also in the button click which submits the modal pop up, i have a

Page.Validate("ValidateGroup");
        if (!Page.IsValid) return;

However, I dont see the validation message printed next to the drop down!

  • 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-06-05T22:00:50+00:00Added an answer on June 5, 2026 at 10:00 pm

    Your drop down list must have the same ValidationGroup. Add ValidationGroup=”ValidateGroup” to your drop down list

    Change InitialValue from “Select Code1!” to “Make a selection.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET dropdownlist like this: <asp:DropDownList ID=ddlMyDropDown runat=server> <asp:ListItem>Please pick one</asp:ListItem> <asp:ListItem>option1</asp:ListItem>
this is my drpdownlist <asp:DropDownList ID=DriverGender runat=server> <asp:ListItem Text=M Value=M></asp:ListItem> <asp:ListItem Text=F Value=F></asp:ListItem> </asp:DropDownList>
<asp:DropDownList ID=ddl1 runat=server> <asp:ListItem Text=First Value=1></asp:ListItem> <asp:ListItem Text=Second Value=2></asp:ListItem> </asp:DropDownList> <asp:TextBox ID=tb1 runat=server/> <asp:Button
Here's my existing code: <asp:DropDownList ID=DropDownList1 runat=server AutoPostBack=True DataSourceID=dsEmployees DataTextField=Last_First DataValueField=EmpNum onselectedindexchanged=DropDownList1_SelectedIndexChanged> </asp:DropDownList>
I've got DropDownList in UpdatePanel as shown below: <asp:UpdatePanel ID=UpdatePanel1 runat=server> <ContentTemplate> <asp:DropDownList ID=DropDownList1
I have an asp.net dropdown like this <asp:DropDownList width=95% ID=RessourceComposantes runat=server DataSourceID=Composantes DataTextField=Description DataValueField=ComposanteID>
hy, i configured dropdownlist : <asp:DropDownList ID=ddl_filter1 runat=server Width=120px DataSourceID=ObjectDataSource1 DataTextField=PLC DataValueField=PLC OnSelectedIndexChanged=ddl_filter1_SelectedIndexChanged />
<asp:UpdatePanel runat=server ID=userRemovalUpdatePanel> <ContentTemplate> <p><label>Remove: </label> <asp:DropDownList runat=server ID=removeUserList /></p> <br /> <asp:Button runat=server
So I have a Web Forms asp control: <asp:DropDownList runat=server ID=ExistingTemplate ClientIDMode=Static /> On
Hi experts please see this code: <asp:UpdatePanel ID=UpdatePanel1 runat=server UpdateMode=Conditional> <ContentTemplate> <table border=1 cellpadding=8

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.