public ActionResult AddTopicMethod() { Topic topic = new Topic(); topic.TopicID = Convert.ToInt32(Request["TopicId"]); topic.Title = Request["TopicTitle"]; topic.AnswerA = Request["AnswerA"]; topic.AnswerB = Request["AnswerB"]; topic.AnswerC = Request["AnswerC"]; topic.AnswerD = Request["AnswerD"]; topic.Answer = Request["Answer"]; topic.CourseID = Convert.ToInt32(Request["CourseID"]); ITopicBLL topicBLL = new TopicManager(); if (topicBLL.AddEntity(topic)) { return(Content("<script>alert('添加成功!');window.location.href='/Home/TopicManager';</script>"));//刷新页面 } else { return(Content("<script>alert('添加失败!');history.go(-1);</script>"));//不刷新退回页面 } }