1,添加asp.net core mvc应用程序

2,添加Controllers控制器文件夹,Views视图文件夹

 

asp.net core-7.在Core Mvc中使用Options

 

然后在Startup类中ConfigureServices方法中注册一下services.Configure<Class>(Configuration);和 services.AddMvc(); ,Configure方法中配置默认路由app.UseMvcWithDefaultRoute();

asp.net core-7.在Core Mvc中使用Options

 

3,在index页面中

asp.net core-7.在Core Mvc中使用Options

 

 最后按 f5

asp.net core-7.在Core Mvc中使用Options

 

相关文章:

  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2021-04-10
  • 2021-10-06
  • 2021-07-22
  • 2021-12-14
  • 2021-08-21
猜你喜欢
  • 2021-11-10
  • 2021-06-24
  • 2021-03-29
  • 2022-12-23
  • 2019-02-22
  • 2022-12-23
相关资源
相似解决方案