title: How to do validation before form is submitted on client side in ASP.NET
body: <p>I have an ASP.NET web form with validators that are disabled. I want to enable validators only AFTER Submit button is clicked and based on if the control is visible or not. </p>
  
  <p>Here is my function:</p>
  
  <pre><code>protected void Submit_Click(object sender, System.EventArgs e)
  {
  if (ddlSite.Visible){    
    rfvSite.Enabled = true;
    base.Validate();
  } else {
    rfvSite.Enabled = false;
  }
  </code></pre>
  
  <p>The above code is working fine. But now I want to check if page is valid or not. If the page is Valid then I want to process the form. I don't know how to do this.</p>