2014-11-03 29 views
0

在MVC5我想他们在登录后用户重定向到特定视图我想我需要改变这一行:如何将用户重定向到登录后查看? 。

@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) 

让我们假设我希望它重定向到一个名为MyView的视图,它必须使用https。我应该在ActionLink中写下什么来做到这一点?

+0

你LO gin POST方法可以包含'return RedirectToAction(“AnotherAction”);'。 [请参阅文档](http://msdn.microsoft.com/en-us/library/system.web.mvc.controller.redirecttoaction(v = vs.118).aspx) – 2014-11-03 23:49:57

回答

0

其实你需要是什么动作

打的动作返回了不同的看法,你在登录操作刚过所有验证的做

Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" }) 

现在是真实的补充一点:

return View("Your different view path");

相关问题