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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:55:52+00:00 2026-05-29T20:55:52+00:00

I have a user control where I have two panels, one is on the

  • 0

I have a user control where I have two panels, one is on the left and the other on the right, on the left there is some customer billing information and on the right some shipping information, each field in the shipping information has a requiredfieldvalidator, these panels are wrapped in a update panel. The default state is that both panels are visible, below the panels there is a checkbox that says “Shipping same as billing”, when you check it the panel on the right “Shipping Panel” disappears and then you continue.

Issue: Lets say I remove the text in the Shipping Name and I dont click anywhere else, then i go to the checkbox “Same as billing” for a moment it shows the validation in red and then it dissapears. I have tried creating a function that disables the validator i.e

RequireFieldValidator1.Enabled = false;

It works fine in the terms it does not show the validation before the shipping panel dissapears, but lets say I change my mind and click it again to display it. Now when I erase the name in the shipping panel and click somewhere else, it does not let me go anywhere but it doesnt show the validation text.

So I did this logic:

if (ckSameBilling.checked)
{
     RequiredFieldValidator.Enabled = false;
}
else
{
      RequiredFieldValidator.Enabled = true;
}

But now it went back to the same behavior like I demostrated above, clear the Shipping Name and click checbox.. i can see the red validation momentarily.

Related code

//All this is wrapped in an update panel
<asp:Panel ID="pnl" runat="server"><div>
    asp:TextBox ID="txtShippingFirstName" runat="server" Width="130px" Columns="30"
     MaxLength="100" asp:TextBox><div>

<asp:RequiredFieldValidator ID="Requiredfieldvalidator1" ErrorMessage="Name Required"
    ControlToValidate="txt" 
    runat="server" Display="Dynamic" CssClass="Error">
</asp:RequiredFieldValidator>
</asp:Panel>

<div style="margin-left: 145px;">
    <asp:CheckBox ID="Billing" runat="server" Font-Bold="True"
        Text"Same as Billing" OnCheckedChanged="Billing_CheckedChanged"
        AutoPostBack="True" />
</div>

Codebehind:

protected void Billing_CheckedChanged(object sender, EventArgs e)
{    
    if (Billing.Checked)
    {
        //Disable the shipping fields validations
        DisableEnable(true);
        pnl.Visible = false;
    }
    else
    {
        DisableEnable(false);
        pnl.Visible = true;
    }
}

private void DisableEnable(bool enable)
{
    if (enableFields)
    {
        Requiredfieldvalidator1.Enabled = false;
        //a bunch of required validations below...
    }
    else
    {
        Requiredfieldvalidator1.Enabled = true;
        //a bunch of required validations below..
    }
}
  • 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-29T20:55:54+00:00Added an answer on May 29, 2026 at 8:55 pm

    Have you tried disabling the validators in Javascript (not server side) before you do the postback of the UpdatePanel?

    You can use the following function client side to disable your validators:

    var yourValidator = document.getElementById('yourValidatorClientID')
    ValidatorEnable(yourValidator, false);
    

    This should stop that ‘flash’ of validation. You could base it of your CheckBox change client side.

    You could also include all your validators in seperate groups for each section and then disable an entire group of validators at once. See the following SO thread for more info:

    Enable/disable asp.net validator controls within a specific "ValidationGroup" with jQuery?

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

Sidebar

Related Questions

I have two tab panels, and in each of these there is a user
I have a user control in a master page with two drop down lists.
I have a user control in my wp7 application which contains two text boxes
I have two User Controls already created now I want to use one as
I have two user controls, in one of them I have a textbox, i
I have an User Control that host another controls like panel, chart controls. Right
I have a recursively defined user control that needs the following properties: there are
My main form has two panels, left docked and right docked. The right side
I have two controls which are both contained within a user control. Panel location:
I'm having an issue where I have made a user control with two content

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.