Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Real-World Web Development with .NET 9

You're reading from   Real-World Web Development with .NET 9 Build websites and services using mature and proven ASP.NET Core MVC, Web API, and Umbraco CMS

Arrow left icon
Product type Paperback
Published in Dec 2024
Publisher Packt
ISBN-13 9781835880388
Length 578 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (17) Chapters Close

Preface 1. Introducing Web Development Using Controllers FREE CHAPTER 2. Building Websites Using ASP.NET Core MVC 3. Model Binding, Validation, and Data Using EF Core 4. Building and Localizing Web User Interfaces 5. Authentication and Authorization 6. Performance Optimization Using Caching 7. Web User Interface Testing Using Playwright 8. Configuring and Containerizing ASP.NET Core Projects 9. Building Web Services Using ASP.NET Core Web API 10. Building Web Services Using ASP.NET Core OData 11. Building Web Services Using FastEndpoints 12. Web Service Integration Testing 13. Web Content Management Using Umbraco 14. Customizing and Extending Umbraco 15. Epilogue 16. Index

Customizing an ASP.NET Core MVC website

Now that you’ve reviewed the structure of a basic MVC website, you will customize and extend it. You have already registered an EF Core model for the Northwind database, so the next task is to output some of that data on the home page.

Defining a custom style

The home page will show a list of the 77 products in the Northwind database. To make efficient use of space, we want to show the list in three columns. To do this, we need to customize the stylesheet for the website:

  1. In the wwwroot\css folder, open the site.css file.
  2. At the bottom of the file, add a new style that will apply to an element with the product-columns ID, as shown in the following code:
    #product-columns
    {
      column-count: 3;
    }
    

Setting up the category images

The Northwind database includes a table of eight categories, but they do not have images, and websites look better with some colorful pictures:

  1. In the...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image