Correct way to use _viewstart.cshtml and partial Razor views?

前端 未结 1 1853
旧时难觅i
旧时难觅i 2020-12-04 07:42

I\'m using _viewstart.cshtml to automagically assign the same Razor Layout to my views.

It\'s a dead simple file in the root of my Views folder that looks like this:

相关标签:
1条回答
  • 2020-12-04 07:49

    If you return PartialView() from your controllers (instead of return View()), then _viewstart.cshtml will not be executed.

    0 讨论(0)
提交回复
热议问题