public ActionResult DeleteConfirmed(int id)
        {
            News_subcategory news_subcategory = db.News_subcategory.Find(id);

            db.News_subcategory.Remove(news_subcategory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,subcategory_name,category_id")] News_subcategory news_subcategory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(news_subcategory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.category_id = new SelectList(db.News_category, "id", "category_name", news_subcategory.category_id);
     return(View(news_subcategory));
 }
        // GET: Admin/News_subcategory/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            News_subcategory news_subcategory = db.News_subcategory.Find(id);

            if (news_subcategory == null)
            {
                return(HttpNotFound());
            }
            return(View(news_subcategory));
        }
        // GET: Admin/News_subcategory/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            News_subcategory news_subcategory = db.News_subcategory.Find(id);

            if (news_subcategory == null)
            {
                return(HttpNotFound());
            }
            ViewBag.category_id = new SelectList(db.News_category, "id", "category_name", news_subcategory.category_id);
            return(View(news_subcategory));
        }