客户端代码:
Ext.Ajax.request({
url: '/AjaxRequest/GetJugeRight?text=chy',
success: function(response, opts) {
var obj = ev
alert(obj);
},
failure: function(response, opts) {
alert("请求失败");
},
params: { nodeid: 1, useid: 1 }
});
Controller 代码:
public ContentResult GetJugeRight(FormCollection form,string text)
{
string useid = form["useid"];
string nodeid = form["nodeid"];
StringBuilder str = new StringBuilder();
str.Append("({");
str.Append(string.Format("useid :'{0}',", useid ));
str.Append(string.Format("nodeid :'{0}',", nodeid ));
str.Append(string.Format("text:'{0}',", text));
str.Append("success:true })");
return Content(str.ToString());
}