工作,我已經創造了查看視圖>共享文件夾動作鏈接不MVC3
具有這種代碼
@if (Request.IsAuthenticated)
{
<text>Welcome <strong>@User.Identity.Name</strong>!
@Html.ActionLink("Log Off", "LogOff", "Account", new { data_role = "button" })</text>
}
else
{
@Html.ActionLink("Log On", "LogOn", "Account", new { data_role = "button" })
}
比我創建控制器文件夾控制器
public class AccountController : Controller
{
//
// GET: /Account/
public ActionResult Index()
{
return View();
}
public ActionResult LogOn()
{
return View();
}
public ActionResult LogOff()
{
return View();
}
}
並右鍵單擊索引logOn和LogOff視圖創建在文件夾中 Views> Account
但是,當我點擊登錄按鈕時,我沒有重定向到登錄頁面。
請幫
你期待什麼網址,你得到了什麼網址?你的控制器是否有[授權]屬性?這個問題需要更多的信息。 – Buildstarted 2011-05-22 02:14:45