public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } podcastinfo info = db.podcastinfoes.Find(id); podcast_comments comment = db.podcast_comments.Find(id); if (info == null) { return(HttpNotFound()); } return(View(info)); }
public ActionResult _AddComments(podcast_comments podcast_comments) { if (ModelState.IsValid) { if (podcast_comments.comment != null) { podcast_comments.commentDate = DateTime.Now; podcast_comments.username = User.Identity.Name; db.podcast_comments.Add(podcast_comments); db.SaveChanges(); return(RedirectToAction("Details/" + podcast_comments.podcast_id)); } else { TempData["Message"] = "Please enter a comment"; return(RedirectToAction("Details/" + podcast_comments.podcast_id)); } } return(PartialView(podcast_comments)); }