1

Currently the root of my Pages folder I have 5 files:

  • _ViewStart.cshtml
  • _ViewImport.cshtml
  • _Layout.cshtml
  • _LayoutInner.cshtml
  • Index.cshtml - finally I page I actually use

That looks a little bit messy, especially with potential of having more _Layout files. So, is it possible to move "special" files (with underscore prefix) to "special" folder, like it was case in ASP.NET MVC with Shared?

Or I am required to keep carrying these files in root of my Razor views folder?

1 Answer 1

1

ViewStart and ViewImport have special meanings in hierarchical folder structures, so they definitely need to stay in root. They can be overridden with files having the same name in subfolders.

As for Layout files, they don't need to be there so I moved them to Shared subfolder and updated the Layout property in ViewStart.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.