I am fetching one row from database in Object format.
here is my .cs code
public JsonResult GetApplicationDetail(string id){
sp_Application_Result AppObj = new sp_Application_Result();
ObjectResult obj = db.sp_Application(id);
foreach (sp_Application_Result i in obj){
AppObj = i;
}
return Json(AppObj, JsonRequestBehavior.AllowGet);
}
and here is my script code
$.ajax({
type: "GET",
url: "/Application/GetApplicationDetail/",
datatype: "json",
data: {"id" : name} ,
success: function (response) {
alert(response);
}
);
when I'm trying to show response, it's showing [Object,object]
I am not getting how to show response result, actually I want to store response data into table.
console.log(response)can expand and print objects, insteadalertcan only print/display strings so either useconsole.logorJSON.stringify(response)beforealertconsole.log(response)or you can transform the json object to string to be able to display it in the alertalert(JSON.stringify(response))console.log()your response? xD