https://blog.csdn.net/lonestar555/article/details/7046717
MVC頁面重定向,主要有以下幾種形式:
1.Response.Redirect();方法
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace MvcDemo.Controllers
- {
- [HandleError]
- public class HomeController : Controller
- {
- public ActionResult Index()
- {
- ViewData["Message"] = "歡迎使用 ASP.NET MVC!";
- Response.Redirect("User/News");
- return View();
- }
- public ActionResult About()
- {
- return View();
- }
- }
- }