With ASP.NET Core 2 around the bend, we get the chance to have a page wounded for something new. In one of the past posts, we quickly referenced the center ASP.NET razor pages.
ASP.NET Razor is another component of Pages Core, which makes page-driven coding situations simpler and progressively gainful.
The public initial impression is for smaller applications to focus only on those pages that razor pages do not have the option to make MVC easier and faster. However, it can be prolonged. Since ASP.NET Core will be the default option when creating a new application Razor Page 2 (Blank, Razor Pages, Web API, MVC), it seems that Razor and # 1 in ASP.NET team page Would like When building a new web application.
The assembly stayed in all types of pages razors and Microsoft.AspNetCore.MVC.RazorPages. MVC Package – Microsoft.AspNetCore.MVC Razor Assembly Yard is also included. This means you can exit the box with a razor MVC page.
If you want to create a simple page with MVC, you had to look at a way to place different places in HTML, HTML, different ViewModel, different space in the room, and it just seemed so much more.
With Razor Pages, you have this code for a file Razor (.cshtml), and the residue of the pages in the file, and (more on this later) represents the URL structure of the application file.
However, you can separate the code of the .cshtml.cs file extension behind for your code. You typically model your views and handlers in the MVC and handle arguments in the file (such as a method of performing the operation). Of course, you can move your view model separately.
- Razor site programming
- You can store all code and HTML in one spot (in the event that you need).
- Location page document razor determine a URL/way on your page
- Razor page year isn’t a resurrection of ASP.NET site pages
- Those are highlights that we can use with MVC, we can likewise utilize a razor page:
o Model official
o Razor support
o Supporting tag
o Html colleague
o Handler (method of activity)
o e.t.c ..
- We are the administrators (OnGet, OnGetAsync, OnPostAsync and so on.).
- File framework (determine page position URL way in venture structure)
- Root envelope is required
- Default by putting away in an envelope root pages (configurable)