I have declared global variable before document.ready()
var getStatus=null;
$(function () {
then in the document.ready function
beforeSubmit: function (postdata, formid) {
$.getJSON('@Url.Action("","")', { Id: postdata.Id},
function (data) {
getStatus = data;
alert(getStatus)// this give the correct status
});
alert(getStatus)// but this one shows null
return [false];
},
I have tried using many ways but didn't get success.Please help