Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. "Microsoft.AspNetCore.Mvc": "1.0.1",
  2. "Microsoft.AspNetCore.Razor.Tools": {
  3. "version": "1.0.0-preview2-final",
  4. "type": "build"
  5. }
  6.  
  7. public void ConfigureServices(IServiceCollection services)
  8. {
  9. services.AddMvc();
  10. }
  11.  
  12. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  13. {
  14. app.UseMvcWithDefaultRoute();
  15. }
  16.  
  17. @using WebUI
  18. @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
  19.  
  20. using Microsoft.AspNetCore.Mvc;
  21.  
  22. namespace WebUI.Controllers
  23. {
  24. public class HomeController : Controller
  25. {
  26. public IActionResult Index()
  27. {
  28. return View();
  29. }
  30.  
  31. public IActionResult MyAction()
  32. {
  33. return View();
  34. }
  35. }
  36. }
  37.  
  38. @{
  39. Layout = null;
  40. }
  41.  
  42. <!DOCTYPE html>
  43. <html>
  44. <head>
  45. <meta name="viewport" content="width=device-width" />
  46. <title>Index</title>
  47. </head>
  48. <body>
  49. <div>
  50. <a asp-action="MyAction">Go to my action</a>
  51. </div>
  52. </body>
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement