// GET: Category/Details/5
        public ActionResult Details(int id)
        {
            var model = _db.GetCategory(id);

            if (model != null)
            {
                return(View("Details", model));
            }
            return(HttpNotFound());
        }
Example #2
0
        public ActionResult GetAllSubcategoryNamesForCategory(int categoryId)
        {
            if (Request.IsAjaxRequest())
            {
                var model = _db.GetCategory(categoryId).Subcategories;
                return(Json(model, JsonRequestBehavior.AllowGet));
            }

            return(HttpNotFound());
        }
        public ActionResult GetAllSubcategoriesForCategory(int categoryId)
        {
            if (Request.IsAjaxRequest())
            {
                var model = _db.GetCategory(categoryId).Subcategories;
                return(PartialView("_Subcategories", model));
            }

            return(HttpNotFound());
        }