Book Image

ASP.NET Core 2 Fundamentals

By : Onur Gumus, Mugilan T. S. Ragupathi
Book Image

ASP.NET Core 2 Fundamentals

By: Onur Gumus, Mugilan T. S. Ragupathi

Overview of this book

The book sets the stage with an introduction to web applications and helps you build an understanding of the tried-and-true MVC architecture. You learn all about views, from what is the Razor view engine to tagging helpers. You gain insight into what models are, how to bind them, and how to migrate database using the correct model. As you get comfortable with the world of ASP.NET, you learn about validation and routing. You also learn the advanced concepts, such as designing Rest Buy (a RESTful shopping cart application), creating entities for it, and creating EF context and migrations. By the time you are done reading the book, you will be able to optimally use ASP.NET to develop, unit test, and deploy applications like a pro.
Table of Contents (14 chapters)

Partial View


Partial views are views that can be reused across your application. Partial views can be thought of as pluggable, reusable blocks that you can call from anywhere and have the content of the partial view displayed. The difference between layouts and partial view is that layouts surround our pages, whereas partial views are contained within our pages.

Consider the following structure of a web page—it's the same layout page that we used earlier, but with a couple of changes. The Latest News block has been added to the Side Section and the Login block has been added to the Top Section. These blocks are not restricted to the Top Section or Side Section and can be used anywhere in your application, including your Content Section, as  shown in the following figure:

These partial views are not restricted to static content and can contain form elements. In the preceding screenshot, the Latest News partial view contains the text content and the login partial view contains form elements...