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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:44:02+00:00 2026-05-22T11:44:02+00:00

I have two search buttons on a page, one linked to a dropdown list

  • 0

I have two search buttons on a page, one linked to a dropdown list and one linked to a dropdown list with a textbox for more search criteria. I have required field validators on all of the aforementioned controls. When I choose something from the first dropdown and click the appropriate search button, the field validator for the textbox fires, disabling the first search button. Is there a way to localize/isolate the validators to only associate with one of the two buttons? Code below:

     <asp:Panel ID="Panel1" runat="server" HorizontalAlign="Center">
<asp:Label ID="Label1" runat="server" Text="Search by status:"></asp:Label>
        &nbsp;
        <asp:DropDownList ID="DdlStatus" runat="server" 
            DataSourceID="SqlDataSource2" DataTextField="Status" DataValueField="Status" AppendDataBoundItems="true">
            <asp:ListItem Text="Choose a status" Value="0" Selected="True"></asp:ListItem>
        </asp:DropDownList>
        &nbsp;
        <asp:Button ID="BtnStatusSearch" runat="server" Text="Search" onclick="BtnStatusSearch_Click" />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" 
            SelectCommand="SELECT [Status] FROM [Status]"></asp:SqlDataSource>
        <asp:Label ID="LblSearch" runat="server" Text="Other search:"></asp:Label>
        &nbsp;
        <asp:DropDownList ID="DdlSearch" runat="server">
            <asp:ListItem Selected="True" Value="0">Choose search criteria</asp:ListItem>
            <asp:ListItem Value="1">Broker</asp:ListItem>
            <asp:ListItem Value="2">Customer</asp:ListItem>
            <asp:ListItem Value="3">Customer State</asp:ListItem>
            <asp:ListItem Value="4">Broker State</asp:ListItem>
        </asp:DropDownList><asp:RequiredFieldValidator ID="RfvDdlSearch" runat="server" Display="Dynamic" 
            ErrorMessage="Required field" ControlToValidate="DdlSearch" CssClass="ErrorMessage"></asp:RequiredFieldValidator>
        &nbsp;&nbsp;
        <asp:TextBox ID="TbSearch" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfvTbSearch" runat="server" Display="Dynamic" 
            ErrorMessage="Required field" ControlToValidate="TbSearch" CssClass="ErrorMessage"></asp:RequiredFieldValidator>
&nbsp;&nbsp;
        <asp:Button ID="BtnSearch" runat="server" onclick="BtnSearch_Click" Text="Search" />
  • 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-22T11:44:04+00:00Added an answer on May 22, 2026 at 11:44 am

    Yes, you can use the ValidationGroup property and set that validation group to your button control: ValidationGroup="button1"

     <asp:RequiredFieldValidator ID="rfv" runat="server" ValidationGroup="button1"
            ErrorMessage="*"></asp:RequiredFieldValidator>
      <asp:Button ID="btnLogin" runat="server" Text="Login" ValidationGroup="button1" OnClick="btnLogin_Click" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two forms on one page: a results form and a search form.
We used to have a search, that checks two columns for some words. Both
I have two classes, and want to include a static instance of one class
I have two threads, one needs to poll a bunch of separate static resources
I have two spreadsheets... when one gets modified in a certain way I want
I have two webapplication, one is a simple authenticationsite which can authenticate the logged
I have a page which has a panel whcih contains various buttons to load
We have some web pages which have two frames, with one frame in the
I'm using tomahawk's datascroller to page though data in a datatable. I have two
I have created a search page uising exposed filters and views module. The user

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.