.net backend return json string , used by frontend

伪代码:

backend:

public string GetJson()

{

 

var lst = xxxLst;

var obj = Json(lst);
return new JavaScriptSerializer().Serialize(obj.Data);

}

 

frontend:

var jsonstr = ajax return GetJson();

$j("#SearchContent").autocomplete({
source: eval(jsonstr)})

 

posted @ 2013-09-10 15:23  Marius Wang  阅读(184)  评论(0编辑  收藏  举报