2
現金下拉列表可能嗎?ASP.NET MVC:緩存組合框
我正在使用Telerik MVC窗口ComboBox,並且窗口(包括ComboBox)的內容正在以部分視圖返回。局部視圖的內容取決於參數列表,但在該窗口的每個div中都有一個組合框,其內容通常不變,並且包含〜2000條記錄。
我在考慮使用單獨的控制器與返回的窗口本身兌現之前返回計算機[「ComboContent」],但可能有一個更好的辦法...
TIA
更新(我控制器代碼):
[AcceptVerbs("GET")]
[OutputCache(Duration = int.MaxValue, VaryByParam = "id")] //Some custom param??
public ActionResult LoadTimeOffset(int id)
{
String error;
IEnumerable<MyModel> model = repo.GetSomeVariableStuff(id, 10, out error); //always varies
ViewData["ComboList"] = new SelectList(repo.GetComboitems(id), "Key", "Value", -1); //changes only on id
if (model.Count() > 0)
{
return PartialView("Partial", model);
}
return Content(error);
}