Showing posts with label Ajax Request in MVC.. Show all posts
Showing posts with label Ajax Request in MVC.. Show all posts

Make Ajax 'GET' request with parameters from MVC view

Make Ajax GET request with parameters from MVC view in mvc  
  
   function GetLocationDetailByPincode(pinCode)
                {
        var locationDetail = null;
        var actionUrl = '@Url.Action("GetLocationDetailByPincode", "SiteCommon")';
        debugger;
        $.ajax({
            type: "GET",
            url: actionUrl + "?pinCode=" + pinCode,
            data: null,
            async: false,
            processData: false,
            success: function (response) {
                debugger;
                locationDetail = response;
            }
        });
        return locationDetail;
    }