제 3 자 목록에서 개체를 가져 오는 중입니다. 따라서 생성자를 설정할 수 없습니다. 두 개의 ActionResult 객체가 제 3 자 객체를 가져오고, 다른 하나는 jquery 자동 완성에 사용됩니다.컨트롤러에서 데이터가 null이되지 않도록 유지해야합니다.
나는 목록을 설정하고 다음 ActionResult에 널 않을에서 그것을 유지하는 방법 ... 각 HTTP 요청에 대한
public class MyController : Controller
{
public List<T> myList;
public ActionResult CallToGetThirdPartList(ThirdPartyObject obj)
{
list = obj.SpecialList;
return View(obj); //important
}
public ActionResult Search(ThirdPartyObject obj) //gets called from jquery
{
var results = from m in myListist //this is null
where m.Title.StartsWith(term)
select new { label = m.Summary, m.id };
return Json(results, JsonRequestBehavior.AllowGet)
}
}
사용되는 캐시, –