Simple ASP.NET MVC views without writing a controller

后端 未结 5 493
一整个雨季
一整个雨季 2021-01-04 10:50

We\'re building a site that will have very minimal code, it\'s mostly just going to be a bunch of static pages served up. I know over time that will change and we\'ll want

5条回答
  •  走了就别回头了
    2021-01-04 11:22

    Couldn't you create a separate controller for all the static pages and redirect everything (other than the actual controllers which do work) to it using MVC Routes, and include the path parameters? Then in that controller you could have logic to display the correct view based on the folder/path parameter sent to it by the routes.

    Allthough I don't know the spark view engine handles things, does it have to compile the views? I'm really not sure.

提交回复
热议问题