Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,
 
I am developing a web portal where I want to check a value of a textbox once the user finished typing in it and leaves it. I want something like textbox leave event. I want to check its value against the value in a SQL server database table. I have tried using the text changed event while keeping the autopostback = true. But still it is not working.
Can anyone help me please................
Posted 16-Apr-13 3:00am
Vreeti689
Edited 16-Apr-13 3:01am
v2
Comments
Ra3IDeN at 16-Apr-13 8:09am
   
Have you tried clicking outside of the textbox when you have typed in your value?
Vreeti at 16-Apr-13 9:06am
   
Yes.. I had tried this...
babu saravanan at 16-Apr-13 13:42pm
   
kindly post your code please
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

onblur event u can called by javascript, and use webservice method to retrieve value from database and compare it at client side only. for reference click here
how javascript use to call server side sql queries using webservice
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

dude i think you have to use jquery ajax .
$("#txtID").blur(function(){
 
    var text=$("#txtID").val();
 
    $.ajax({
        url:"Default.aspx/WebMethod",
        type:"POST",
        data:{value:text},
        success:function(data){
        alert('done');
        },
        error:function(msg){
          alert('error');
        }
    });
});
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 16 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100