https://jeffprogrammer.wordpress.com/2016/05/18/asp-net-mvc-redirect-to-view/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace prjTest.Controllers
{
public class DefaultController : Controller
{
// GET: Default
public ActionResult Index()
{
string virtualPath = System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpRuntime.AppDomainAppVirtualPath;
System.Web.HttpContext.Current.Response.Redirect(virtualPath + "Apply/Index", true);
//下面不會跑
ViewBag.msg = virtualPath;
return View();
}
}
}
沒有留言:
張貼留言