$(function () {
    $('input#UserName').blur(function () {
        var username = $('input#UserName').val();
        $.ajax(
        {
            type: "POST",
            url: "Profile/CheckAvailability",
            data: "username=" + username,               
            success: function (result) {
                //Some code here
            },
            error: function () {
                alert("Sorry! We could not receive your feedback at this time.");                
            }
        });
    });
});
and the code on Profile controller
    [HttpPost]
    public JsonResult CheckAvailability(string username)
    {
        bool isAvailable = false;
        //Some code here
        return Json(new {success = isAvailable});
    }
Each time alert("Sorry! We could not receive your feedback at this time."); is being triggered.
Thanks.
 
     
     
    