How can i cache my items and values for dropdown list in MVC?
Is there a way to do so?
I am doing that in controller.
Sample code is.......
public ActionResult Index()
{
RegionTasks regionTasks = new RegionTasks();
ViewBag.Region = GetRegions();}
My controller has function as below.
[OutputCache(Duration = 10, Location = System.Web.UI.OutputCacheLocation.Server)]
private IEnumerable<SelectListItem> GetRegions()
{
RegionTasks regionTasks = new RegionTasks();
return regionTasks.GetRegions();
}
I have tested and it not caches the item for region.
How can i do that?