Пример #1
0
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            // accessing parent resource id
            if (!filterContext.RouteData.Values.ContainsKey("blogId")) return;

            var blogId = int.Parse(filterContext.RouteData.Values["blogId"].ToString());
            _blog = new Blog{ Id = blogId };
        }
        public ActionResult Update(int id, Blog blog)
        {
            TempData["notice"] = "Updated " + id;

            return RedirectToAction("Index");
        }