This document has multiple versions. Select the options best fit for you.


Web Application Development Tutorial - Part 2: The Book List Page

About This Tutorial

In this tutorial series, you will build an ABP based web application named Acme.BookStore. This application is used to manage a list of books and their authors. It is developed using the following technologies:

  • Entity Framework Core as the ORM provider.
  • Blazor as the UI Framework.

This tutorial is organized as the following parts;

Download the Source Code

This tutorial has multiple versions based on your UI and Database preferences. We've prepared a few combinations of the source code to be downloaded:


Before starting to the UI development, we first want to prepare the localization texts (you normally do this when needed while developing your application).

Localization texts are located under the Localization/BookStore folder of the Acme.BookStore.Domain.Shared project:


Open the en.json (the English translations) file and change the content as below:

  "Culture": "en",
  "Texts": {
    "Menu:Home": "Home",
    "Welcome": "Welcome",
    "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit",
    "Menu:BookStore": "Book Store",
    "Menu:Books": "Books",
    "Actions": "Actions",
    "Close": "Close",
    "Delete": "Delete",
    "Edit": "Edit",
    "PublishDate": "Publish date",
    "NewBook": "New book",
    "Name": "Name",
    "Type": "Type",
    "Price": "Price",
    "CreationTime": "Creation time",
    "AreYouSure": "Are you sure?",
    "AreYouSureToDelete": "Are you sure you want to delete this item?",
    "Enum:BookType:0": "Undefined",
    "Enum:BookType:1": "Adventure",
    "Enum:BookType:2": "Biography",
    "Enum:BookType:3": "Dystopia",
    "Enum:BookType:4": "Fantastic",
    "Enum:BookType:5": "Horror",
    "Enum:BookType:6": "Science",
    "Enum:BookType:7": "Science fiction",
    "Enum:BookType:8": "Poetry"
  • Localization key names are arbitrary. You can set any name. We prefer some conventions for specific text types;
    • Add Menu: prefix for menu items.
    • Use Enum:<enum-type>:<enum-value> naming convention to localize the enum members. When you do it like that, ABP can automatically localize the enums in some proper cases.

If a text is not defined in the localization file, it fallbacks to the localization key (as ASP.NET Core's standard behavior).

ABP's localization system is built on ASP.NET Core's standard localization system and extends it in many ways. See the localization document for details.

Create a Books Page

It's time to create something visible and usable! Right click to the Pages folder under the Acme.BookStore.Blazor project and add a new razor component, named Books.razor:


Replace the contents of this component as shown below:

@page "/books"


@code {


Add Books Page to the Main Menu

Open the BookStoreMenuContributor class in the Blazor project add the following code to the end of the ConfigureMainMenuAsync method:

    new ApplicationMenuItem(
        icon: "fa fa-book"
        new ApplicationMenuItem(
            url: "/books"

Run the project, login to the application with the username admin and the password 1q2w3E* and see the new menu item has been added to the main menu:


When you click to the Books menu item under the Book Store parent, you are being redirected to the new empty Books Page.

Book List

We will use the Blazorise library as the UI component kit. It is a very powerful library that supports major HTML/CSS frameworks, including the Bootstrap.

ABP Framework provides a generic base class, AbpCrudPageBase<...>, to create CRUD style pages. This base class is compatible to the ICrudAppService that was used to build the IBookAppService. So, we can inherit from the AbpCrudPageBase to automate the code behind for the standard CRUD stuff.

Open the Books.razor and replace the content as the following:

@page "/books"
@using Volo.Abp.Application.Dtos
@using Acme.BookStore.Books
@using Acme.BookStore.Localization
@using Microsoft.Extensions.Localization
@inject IStringLocalizer<BookStoreResource> L
@inherits AbpCrudPageBase<IBookAppService, BookDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateBookDto>

        <DataGrid TItem="BookDto"
                <DataGridColumn TItem="BookDto"
                <DataGridColumn TItem="BookDto"
                <DataGridColumn TItem="BookDto"
                <DataGridColumn TItem="BookDto"
                <DataGridColumn TItem="BookDto"

If you see some syntax errors, you can ignore them if your application properly built and run. Visual Studio still has some bugs with Blazor.

  • Inherited from the AbpCrudPageBase<IBookAppService, BookDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateBookDto> which implements all the CRUD details for us.
  • Entities, TotalCount, PageSize, OnDataGridReadAsync are defined in the base blass.
  • Injected IStringLocalizer<BookStoreResource> (as L object) and used for localization.

While the code above pretty easy to understand, you can check the Blazorise Card and DataGrid documents to understand them better.

About the AbpCrudPageBase

We will continue to benefit from the AbpCrudPageBase for the books page. You could just inject the IBookAppService and perform all the server side calls yourself (thanks to the Dynamic C# HTTP API Client Proxy system of the ABP Framework). We will do it manually for the authors page to demonstrate how to call server side HTTP APIs in your Blazor applications.

Run the Final Application

You can run the application! The final UI of this part is shown below:


This is a fully working, server side paged, sorted and localized table of books.

The Next Part

See the next part of this tutorial.

In this document