jquery - Donot redirect to json code without debbuging the code -
i trying redirect json method jquery .its working fine while putting debugger or putting alert box not able redirect without debugger plz suggest solution thanks
//jquery code
function validatemeetingowner() { $.ajaxsetup({ cache: false }); debugger; var flagvalue; var value = $("#meetingowner").val(); if ($("#meetingowner").val() != "") { $.ajax({ datatype: "json", url: '/meetingform/validationmeetingowner', data: { id: value }, traditional: true, success: function (result) { debugger; if (result.result1 == "false") { debugger; flagvalue = result.flag; alert(result.flag); alert(result.result1); alert("pleas enter valid user meeting owner"); $("#meetingowner").val(""); } else { flagvalue = "1"; } } }); if (flagvalue == "0") { return false; } } }
//controller code
public jsonresult validationmeetingowner(string id) { string result1 = string.empty; string flag = string.empty; var ifexist = dbcontext.users.any(x => x.name == id || x.id == id || x.email == id); if (!ifexist) { result1 = "false"; flag = "0"; } else { result1 = "true"; flag = "1"; } return json(new { result1, flag }, jsonrequestbehavior.allowget); }
Comments
Post a Comment