【发布时间】:2009-05-11 08:45:39
【问题描述】:
我正在尝试将其用于登录页面。
if (Session["UserID"] == null)
Server.Transfer("/Account/Login", true);
但我得到了异常 -> 执行子请求 /Account/Login 时出错。
【问题讨论】:
-
+1'ed Mark 的回答。我会使用“return RedirectToAction("SomeOtherAction");”。您是否出于某些原因不希望访问者看到重定向的 URL?
标签: asp.net-mvc asp.net-mvc-routing