Chapter 7. Rendering HTML using Razor views
This chapter covers
- Creating views to display HTML to a user
- Using C# and the Razor markup syntax to generate HTML dynamically
- Reusing common code with layouts and partial views
In the previous four chapters, I’ve covered a whole cross-section of MVC, including the MVC design pattern itself, controllers and actions, routing, and binding models. This chapter shows how to create your views—the UI to your application. For desktop apps, that might be WinForms or WPF. For Web APIs, that might be a nonvisual view, such as a JSON or XML response, which is subsequently used to generate HTML in the client’s browser. For traditional web applications, the UI is the HTML, CSS, and JavaScript that’s delivered ...
Get ASP.NET Core in Action now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.