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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:47:03+00:00 2026-05-16T17:47:03+00:00

For validating login field (at register form) I use customValidator <asp:CustomValidator id=uniqueLoginValidator class=validator runat=server

  • 0

For validating login field (at register form) I use customValidator

        <asp:CustomValidator id="uniqueLoginValidator" class="validator" runat="server" ControlToValidate="tbUserName" ErrorMessage="Login duplicate" ClientValidationFunction="LoginValidate"/>

For validate login I need consume wcf, so decide use web-methods

   <script type="text/javascript">
   function LoginValidate(oSrc, args) {
       var login = $(".loginField").val();
       PageMethods.ValidateLogin(login,OnRequestComplete, OnRequestError);
       return;
   }
   function OnRequestComplete(result, userContext, methodName) {
       return;
   }

   function OnRequestError(error, userContext, methodName) {
       if (error != null) {
           alert(error.get_message());
       }
  </script>

My web-method like:

   [WebMethod]
   public static bool ValidateLogin(string login)
   {
        //wcf consuming
        return res;
    }

For successfull validating I should setup args at ClientValidationFunction, but I get result validation only at callBack. So how can I setup args for validation work.

  • 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-16T17:47:04+00:00Added an answer on May 16, 2026 at 5:47 pm

    The problem is that the line

    PageMethods.ValidateLogin(login,OnRequestComplete, OnRequestError);
    

    initiates a asynchronous call to the page method and return immediately: it does not block until that call has completed.

    See http://www.codeproject.com/KB/validation/Async_CustomValidator.aspx for a discussion and a solution (a new validator control).

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

Sidebar

Related Questions

I have an asp.net form with a login section and a register section. There
What are other suggestions and sample code for efficiently validating the Register and/or login
I have been attempting to use ASP.NET MVC remote validation for username login access
I'm experimenting with validating forms in the asp.net MVC framework. I'm focusing on server
I am using MVC3 and I want to have LogIn form and Register form
I want to do validation of a password field on a login form. The
I'm using authlogic with my user model, with the login field set to use
I've setup my login functions in CodeIgniter (email/password). The email field is validating properly
While validating my CSS on http://jigsaw.w3.org/css-validator/ I am getting following errors: 1.Property zoom doesn't
I'm validating my form, just checking if in the fields where a number should

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.