title: Custom Validation not working in ASP.NET
body: <p>I need to have a custom validation for a "Save" operation in my page. The requirement is that, I need to display the alert and when I click the OK button in the alert, my page should not be posted back. 
  Here goes my code.</p>
  
  <pre><code>function RedirectForSaveValidation(source,arguments) {
  
      var StatusFlag = '';
      StatusFlag = document.getElementById('&lt;%= HiddenStatusFlag.ClientID%&gt;');
  
      if (StatusFlag == "F") {
          alert("Selected student entry has been qualified for lead. Entry cannot be modified...!");
          arguments.IsValid = false;
      }
      if (StatusFlag == "Q") {
          alert("Selected student has been scheduled for interview/counselling. Entry cannot be modified...!");
          arguments.IsValid = false;
      }
      if (StatusFlag == "S") {
          alert("Selected student entry has been scheduled with interview/counselling. Entry cannot be modified...!");
          arguments.IsValid = false;
      }
      if (StatusFlag == "I") {
          alert("Selected student entry has been converted to Intake. Entry cannot be modified...!");
          arguments.IsValid = false;
      }
      window.location.assign("EnquiryRegister.aspx");
  }
  </code></pre>
  
  <p>I call this function in my button click.</p>
  
  <pre><code>&lt;asp:Button ID="btnSaveEnquiryRegister" runat="server" Text="Save Enquiry Register" CssClass="button" OnClick="btnSaveEnquiryRegister_Click" ValidationGroup="valEnquiry" OnClientClick="RedirectForSaveValidation();"/&gt;
  </code></pre>
  
  <p>The issue is, I am not getting any alert as I have specified and my page is posted back. What am I missing?</p>