I'm learning some basic stuffs in razor. I'm a little confused about the extension file: views and partial views seem to share the same extension cshtml. I thought that was a mistake on my behalf, but I've re-checked the checkbox, I get the same extension for both types of files.
Besides, with webform view engine, it's easier to locate views by their colors or/and extensions (View are white-.aspx, Partial are yellow-.ascx, Master are white/blue-.master)
If that's the way it has to be now, why would views and partial views share the same extension? Is there any reason they made them all have the same extension?
Thanks for helping
Razor views and partial views don't need a seperate file extension because both use the same base class.
In contrast, WebForms (ASPX) pages, user controls, and master pages all derive from different base classes which is why the distinction was necessary. It's simply a result of design decisions made during the creation of Asp.Net WebForms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With