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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:58:26+00:00 2026-06-08T12:58:26+00:00

I have very simple aspx page: <%@ Page Language=C# AutoEventWireup=true CodeFile=Default.aspx.cs Inherits=_Default %> <!DOCTYPE

  • 0

I have very simple aspx page:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>

<body>
    <form id="form1" runat="server">
    <div>
        <asp:textbox runat="server" ID="tbText" ValidationGroup="Address"></asp:textbox>
        <br />
        <asp:RequiredFieldValidator ID="rfvText" runat="server" ControlToValidate="tbText" 
            ValidationGroup="Address" ErrorMessage="RequiredFieldValidator">Enter text</asp:RequiredFieldValidator>
        <br />
        <asp:Button runat="server" Text="Submit" ID="btnSubmit" OnClick="Submit_Click" 
            ValidationGroup="Address" OnClientClick="DisableValidator();" />
        <script type="text/javascript">
            function DisableValidator() {
                alert('Called and disable validators before submit');

                var validator = document.getElementById("<%=rfvText.ClientID%>");
                validator.validationGroup = "someGroup";
                ValidatorEnable(validator, false);
            }
        </script>
    </div>
    </form>
</body>
</html>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Submit_Click(object sender, EventArgs e)
    {
        Validate("Address");
        if (!IsValid)
        {
            throw new Exception("Page is no valid");
        }
    }
}

All elements on the page have ValidationGroup=”Address”, but I need disable my validator just before I click on the button. So, on client site it disables, but when I try to validate it on the server, my page isn’t valid on the server but valid on client.

How can I disable validator on client to became disable on the server also?

Thanks!

  • 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-08T12:58:27+00:00Added an answer on June 8, 2026 at 12:58 pm

    You would have to programmably disable it when the page posts back, however you interpret that validator should be disabled on the client then would need to be replicated on the server, and set Enabled="false".

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

Sidebar

Related Questions

I have very simple aspx page & code: <%@ Page Language=C# AutoEventWireup=true CodeFile=Default.aspx.cs Inherits=_Default
My app is a very simple one page type app- It has Default.aspx I'm
We have a very simple page for displaying the records. Basically, it passes certain
I have a very simple login page with 1 textbox for username, 1 textbox
I have a very simple ASP.Net page that acts as a front end for
So, I'm making an ASP.NET page in C#. I have a very simple form
I have a feeling I'm missing one small thing. I have very simple page,
I have a very simple C# class: namespace mybox { public class userAccount :
I have a very simple page built in asp.net (.NET Framework 4) which has
I have apsx page that has the following simple code: <%@ Page Title= Language=C#

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.