How do to get a simple text and display it in an alert, via ajax with ExtJS 4 from a controller in c #.
example:
//Server
public JsonResult simpleData(){
var text = "simple data";
return Json(text, JsonRequestBehavior.AllowGet);
}
How do to get a simple text and display it in an alert, via ajax with ExtJS 4 from a controller in c #.
example:
//Server
public JsonResult simpleData(){
var text = "simple data";
return Json(text, JsonRequestBehavior.AllowGet);
}
your code
public JsonResult simpleData(){
var text = "simple data";
return Json(text, JsonRequestBehavior.AllowGet);
}
must be :
public JsonResult simpleData(){
var text = "simple data";
return Json(new {data = text}, JsonRequestBehavior.AllowGet);
}
for ajax in EXTJS 4 (maybe I'm wrong), read here: Extjs4 - Ajax Request : Url generation