public ActionResult Add_New_Topic(Topic topic) { if (!ModelState.IsValid) { var list = ModelState.Values; ViewBag.InterId = topic.IntermediateCategoryId; return(View("Add_New_Topic", topic)); } //string UserId = User.Identity.GetUserId(); string UserId = GetUserId(); repository.Add_To_Topics_And_User(topic, UserId); return(RedirectToAction("Show_Topics", new { controller = "Topic", action = "Show_Topics", id = topic.IntermediateCategoryId })); }