What are ASP.NET variations? [duplicate]

2

What are the variations within ASP.NET?

The main characteristics and for what type of activity are they most recommended?

When searching I have come across for example with ASP.NET, ASP.NET MVC, ASP.NET Core, ASP.NET Razor.

I came to research on, but I could not quite understand.

    
asked by anonymous 19.04.2018 / 13:56

2 answers

6

ASP.NET

Initially this is what we call WebForms today. WebForms was heavily used, but it has already fallen into disuse and apparently fell on staff disgust. I can not say in detail, but the idea of WebForms was to build a web application that was more like desktop applications, trying to maintain state. You can see some status information in What is a "stateless protocol," such as HTTP? .

Nowadays the name represents more the platform itself. So, in Visual Studio, to create a web application, you first have to choose the ASP.NET Application and then you must specify whether it is WebForms, MVC, WebAPI, etc.

Each of these "types" have a different way of working, they range from the philosophy and design pattern to how the code is written.

ASP.NET MVC

It is an ASP.NET "project type" that follows the MVC (Model-View-Controller) standard - you can read more about the MVC standard at What is MVC (Model, View, Controller)? . In it, ASP.NET Razor is practically intrinsic (see below) as view engine , in the old versions it was still possible to choose between Razor and is called ASPX (which also ended up falling out of use).

ASP.NET WebAPI

It is also an ASP.NET project type that is intended to serve HTTP requests (just like in ASP.NET MVC), but without having to worry about views (unlike ASP. NET MVC).

In any case, the project organization is very similar to ASP.NET MVC.

ASP.NET Core

is the new ASP.NET . Yes, the framework has been redesigned and rewritten (as well as the .NET Framework). This has already had other names such as: ASP.NET vNext or ASP.NET 5, such as seen here .

ASP.NET Razor

It's the view engine behind ASP.NET MVC applications (and also in Core applications). This tool is responsible for rendering the code written in the .cshtml , .vbhtml and similar files to HTML code. For more details on view engines you can read the question What is a Engine? , more specifically the Maniero's answer that talks about Razor itself.

In ASP.NET Core, there is also ASP.NET Razor Pages. It is a kind of simplification of what already exists in ASP.NET Core MVC. It is recommended for simpler cases that do not require all MVC bureaucracy.

    
19.04.2018 / 15:19
2

To complement LINQ responses

ASP.Net

ASP.Net is a platform for creating Web applications. It's like a junction of the old Classic ASP pages and the .Net Framework. In classic ASP we would write the server code in the middle of HTML, so the server would read this code and render the page according to instructions in VBScript (language used in Classic ASP pages along with HTML). ASP.Net was born from the junction of the best it had in Classic ASP with the .Net framework.

ASP.Net Core

Recently the .Net framework code began to be rewritten to be more modular and multiplatform, so .Net Core is the evolution of .Net. As such, ASP.Net Core is an ASP.Net evolution that has also been rewritten.

ASP.Net MVC and Razor

MVC is a software architecture standard where business logic is separated from the presentation (Web page or screen of a program) and the interaction between the two layers is done through the Controller . ASP.Net MVC is a platform based on ASP.Net and MVC architecture and implements functionality to better work with Model, View, and Controller interactions. Control and business logic (Model) are written in server language, that is, C # or VB. In order for the server to communicate with the View (presentation) layer, HTML pages must have server codes as well. It is possible to write HTML + C # in the same file, so the server interprets C # and renders the HTML page to the user with the instructions passed by the language. To further facilitate this process was born Razor, which is the rendering platform for ASP.Net MVC. With Razor you can create pages with C # code more productively because it greatly facilitates the interaction between Vision and Control. The Razor code (* .cshtml files that are written in HTML, C #, and Razor directives) is interpreted by the server and rendered according to the information and instructions passed in Razor (pseudo-language) and C #.

Conclusion

One platform complements the other to accomplish a specific goal. .Net Core is the basis for ASP.Net, which allows you to create web pages rendered by the server. ASP.Net MVC is the MVC standard implemented on the ASP.Net platform, functioning as a platform with features that facilitate MVC interactions. Razor is a programming pseudolage, which works on the MVC view layer, which is interpreted by the server and thus generated the HTML page.

    
19.04.2018 / 19:30