1

I have _PageStart.cshtml in /View/ (so it's path is ~/View/_PageStart.cshtml)

During debugging, none of the breakpoints set in _PageStart are being hit.

MushinNoShin
  • 4,695
  • 2
  • 32
  • 46

1 Answers1

5

By convention, file name should be _ViewStart.cshtml in asp.net MVC view folder. It is similar as _PageStart.cshtml in asp.net web form.

And if you return PartialView() from your controllers (instead of return View()), then _viewstart.cshtml will not be executed. [ Correct way to use _viewstart.cshtml and partial Razor views? ]

Community
  • 1
  • 1
Min Min
  • 6,188
  • 2
  • 19
  • 17