Thursday, January 23, 2014

Action Filters in MVC

 1)OutputCache  Filters in MVC:

Controler:

[OutputCache(Duration = 10)]
        public ActionResult test()
        {
            ViewBag.Date = DateTime.Now.ToString("T");
           
            return View();
        }

View:
@{
    ViewBag.Title = "test";
    @ViewBag.Date;
}

test

No comments:

Post a Comment