Asp.net-mvc – Naming convention to differentiate partial views from normal views

asp.net-mvcnaming-conventionsrazor

Is there any unofficial standard naming convention for partial views? I've seen someone suggested prefixing with "_", others postfixing with "Partial", I know the question is subjective, but since there is no official guideline, I'd like to know what the majority here uses for naming their partial views. Perhaps the most voted answer WILL become the standard.

Update: I'm using ASP.NET MVC 3 with Razor as the view engine, in previous versions you didn't need a convention because you had the .ascx extension

Best Answer

If you look at WebMatrix, the convention is to prefix Razor files that are not meant to be served directly with a leading underscore. That includes partials and layout pages. Then if you look at MvcScaffolding, you can see that the default templates generate files using the same naming convention.

Read this for an explanation as to why that convention might be used.