Using ASP.NET MVC web forms we can put output cache either in controller level or view level. How can we mention "outputcache" in .cshtml page?
I did not find it anywhere. Where can I get the syntax?
What do you mean "ASP.NET MVC Web Forms"? If you're referring to the OutputCache
attribute in the Page directive, that is ASP.NET Web Forms.
ASP.NET MVC has Output Caching on the controller action level:
[OutputCache(Duration=10, VaryByParam="none")]
public ActionResult Index()
{
return View();
}
This is irrespective of the view engine (ASPX/Razor).