Click here to Skip to main content
12,405,303 members (66,976 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET SQL-Server , +
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 2:00am
Vreeti714
Updated 16-Apr-13 2:01am
v2
Comments
Ra3IDeN 16-Apr-13 8:09am
   
Have you tried clicking outside of the textbox when you have typed in your value?
Vreeti 16-Apr-13 9:06am
   
Yes.. I had tried this...
babu saravanan 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 16 Apr 2013
Copyright © CodeProject, 1999-2016
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