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

  • Home
  • SEARCH
  • 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 6855789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:48:08+00:00 2026-05-27T01:48:08+00:00

Q: I have a RequiredFieldValidator on my page ,when i click the button which

  • 0

Q:

I have a RequiredFieldValidator on my page ,when i click the button which is (postback triggered) it makes the postback, although the field which is required wasn’t entered !
What’s the reason to this behavior?

My .aspx:

                       <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <Triggers>
                                <asp:PostBackTrigger ControlID="btn_Search" />
                            </Triggers>
                            <ContentTemplate>
                                <asp:ImageButton ID="btn_Search" runat="server" ImageUrl="~/Images/save.png" 
                                    OnClick="btn_Search_Click" OnClientClick="return postbackButtonClick();" />
                            </ContentTemplate>
                        </asp:UpdatePanel>

                     <asp:DropDownList ID="ddl_department" runat="server" Width="200px" OnSelectedIndexChanged="ddl_department_SelectedIndexChanged"
                            AutoPostBack="True">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddl_department"
                            Display="Dynamic" ErrorMessage="*" InitialValue="-1"></asp:RequiredFieldValidator>

                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddl_study" runat="server" Width="200px">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddl_study"
                                    Display="Dynamic" ErrorMessage="*" InitialValue="-1"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="ddl_department" EventName="SelectedIndexChanged" />
                            </Triggers>
                        </asp:UpdatePanel>

                        <script type="text/javascript">
                            var updateProgress = null;
                            function postbackButtonClick() {
                                updateProgress = $find("<%= UpdateProgress1.ClientID %>");
                                window.setTimeout("updateProgress.set_visible(true)", updateProgress.get_displayAfter());
                                return true;
                            }
                        </script>
  • 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-27T01:48:09+00:00Added an answer on May 27, 2026 at 1:48 am

    Remove return clause from LinkButton’s OnClientClick property value: OnClientClick="postbackButtonClick()" and rewrite postbackButtonClick as below:

    function postbackButtonClick() {
         Page_ClientValidate();
    
         if (Page_IsValid) {
              updateProgress = $find("<%= UpdateProgress1.ClientID %>");
              window.setTimeout("updateProgress.set_visible(true)", updateProgress.get_displayAfter());
              return true;
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASPX page with two RequiredFieldValidator and a button to go to
I have used ValidatorEnable to disable a RequiredFieldValidator in javascript. However on postback the
I have some code where I need two separate required field validators for one
I have a master page that contains a search box which is validated as
So I have made a custom required field validator that turns the background of
I have a page with a RadioButtonList which should post back when the selection
I have a simple form with a few required field validators and a validation
I'm developing a web page in Asp.Net 1.1 and have a DataGrid which allows
I am using RequiredFieldValidator in my asp.net program. I have a sign out button
i have two buttons on the page. One button is responsible for text fields

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.