I have the following code (in MVC3):
public JsonResult GetTown(string term) { db = new SHAMUTEntities1(); var data = db.towns.Where(t => t.name.Contains(term)) .Take(10) .Select(t => new {label=t.name }).ToArray(); return Json(data, JsonRequestBehavior.AllowGet); } }
I get the following error:
System.Web.Helper.Json is a type, but used as a variable
Can anyone help with this. thanks
source share