Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. Html.ActionLink("Link Text", "ActionName", "ControllerName", new { Area = "AreaName" }, new{})
  2.  
  3. Html.ActionLink("home", "Index", new { area = "", controller = "Home" })
  4.  
  5. @if (Request.IsAuthenticated)
  6. {
  7. <text>
  8. Hello, @Html.ActionLink(User.Identity.Name, "Manage", "Account", new { area = "" }, htmlAttributes: new { @class = "username", title = "Manage" })!
  9. @using (Html.BeginForm("LogOff", "Account", new { area = "" }, FormMethod.Post, new { id = "logoutForm" }))
  10. {
  11. @Html.AntiForgeryToken()
  12. <a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
  13. }
  14. </text>
  15. }
  16. else
  17. {
  18. <ul>
  19. <li>@Html.ActionLink("Register", "Register", "Account", new { area = "" }, htmlAttributes: new { id = "registerLink" })</li>
  20. <li>@Html.ActionLink("Log in", "Login", "Account", new { area = "" }, htmlAttributes: new { id = "loginLink" })</li>
  21. </ul>
  22. }
  23.  
  24. Html.ActionLink("Text", "ActionName", "ControllerName", new { Area = "AreaName" }, null)
  25.  
  26. @{ var awesomeArea = new { area = "Awesome" }; }
  27.  
  28. @Html.Action("Something", "Somewhere", awesomeArea)
  29. @Html.ActionLink("Stuff", "FooBar", awesomeArea)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement