You are on page 1of 1

Chapter 6 General Blazor

Figure 6-1.  The example project layout with pages added


To understand the interactions better, we will use a single project
(Figure 6-1) with three pages, and in those, we will explore JavaScript
interactions, events, and their arguments. The project is a normal client-side
project, which contains three pages: JSinteractionsPage, UIeventargsPage,
and UIeventsPage. The routes for pages are stated according to their names.

Execute JavaScript Function


JavaScript interaction happens through IJSRuntime interface, which needs
to be injected for a page where you will use it.

Listing 6-1.  JavaScript interactions page

@page "/JSinteractionsPage"
@inject IJSRuntime js

<p>a</p>
<p><input @bind="@a"></p>

114

You might also like