Alex Kapustian Alex Kapustian - 1 month ago 4x
ASP.NET (C#) Question

Is it possible to use MVC without pages?

I know that MVC is a design pattern that separates Model, View, Controller.
Model - Logic
View - Client View
Controller - connection between the two.

In case I want to change one of this things it will be easy just to change view\Model and the controller.

So is it possible to use only WebApi and MVC without Aps.Net pages (cshtml files)?


You can return html files

return new FilePathResult("path/FileName.html", "text/html");

And .cshtml files are Razor View Engine files, not Asp.Net pages. You can alson change the view engine, see here for a list of .net view egines.