我需要从我的应用程序MVC 3中插件jquery.tagHandler的ajax请求中获取数据,这是页面官方http://ioncache.github.com/Tag-Handler/,这是我的应用程序代码:
$("#tags").tagHandler({
getData: { texto: 'test 123' },
getUrl: '@(Url.Action("GetTags"))',
autocomplete: true,
maxTags: 5,
initLoad : true
});
[HttpGet]
public JsonResult GetTags(string texto)
{
var result = _ServiceTags.Search(texto);
return Json(result);
}
当安排我的应用程序时,这不会调用方法GetTags。
请帮忙!!!
提前感谢
MVC3具有JsonResults的安全功能。您需要修改您的退货,使其看起来像:
return Json(result, JsonRequestBehavior.AllowGet);