[Solved] Check if username already exists [closed]


In the onblur event of the text box, get the value of textbox and using jQuery ajax, make a call to a server page where you check it and return appropriate results. based on the results show the message to user (Available or Not Available)

Include jQuery in your page and have this script also

$(function(){
  $("#txtUserName").blur(function() {
     var userName=$(this).val();
     if(userName!="")
     {
       $.get("checkusername.aspx?username="+userName+"&t="+$.now(),function(data){
           if(data=="1")
           {
             $("#msgDiv").html("Not Available");             
           } 
           else
           {
             $("#msgDiv").html("Available :) ");
           } 

       });    
     }    
  });   

});

Assumuing checkusername.aspx page will read the querystring value and check in the database and return(Response.Write()) “1” or “0”

I prefer to use a Generic handler (.ASHX file) to do the server side checking instead of using the aspx file.

solved Check if username already exists [closed]