I am attemptin to use jquery to do check username while filling out a
form. I have already done it with MSAJAX but i thought it would be fun
to do it with jquery. However it does not work Can anyone point out
where i am going wrong? I am using the jquery ajax method to call a
codebehind WebMethod. The WebMethod works since it the same one i used
for the MS AJAX version.

Thanks,
Ashok

Here is the jquery:

<script type="text/javascript" >
    var $j = jQuery.noConflict();
    $j(document).ready(function() {

        $j("#<%=Textbox1.ClientID %>").blur(function() {
            $j.ajax({
                type: "POST",
                url: "jquerysample.aspx/CheckUserName",
                data: $j("#<%=Textbox1.ClientID %>").val(),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(result) {

                if (result == true) {
                    $j("#divChecking").text(result)
                    }

                    else {
                    //do domething else here

                    }
                }

            });
        });
    });

</script>

Reply via email to