35
loading...
This website collects cookies to deliver better user experience
"Blazor is a framework for building interactive client-side web UI with .NET."
"Blazor is a free and open-source web framework that enables developers to create web apps using C# and HTML."
"WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications."
"It is expected that JavaScript and WebAssembly will be used together in a number of configurations"
"With WebAssembly, web browsers are more like app stores — where the end-user experience is more near-native performance."
"WebAssembly describes a memory-safe, sandboxed execution environment that may even be implemented inside existing JavaScript virtual machines. When embedded in the web, WebAssembly will enforce the same-origin and permissions security policies of the browser."
"ASP.NET Core is a cross-platform, high-performance, open-source framework for building modern, cloud-enabled, Internet-connected apps."
"A single-page application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of a web browser loading entire new pages"
new
(templating), build
, restore
, publish
, run
, test
, pack
, and migrate
commands (to name a few) — you're likely to find success."The .NET platform prides itself on having a great set of APIs that are very usable and make you extremely productive no matter what kind of application you're building. With Wasm, this power is now also available when you build browser-based applications using Blazor WebAssembly."
Blazor's component model makes building apps a joy. It's simple to get going but offers lots of customization when you need it.
— Chris Sainty @chrissainty
.NET productivity. I can use my existing skills, workflow, tools, and previously written libraries. There's no npm
or webpack
, instead, I have the .NET stack and its ecosystem, which makes me super productive.
— Ed Charbeneau @edcharbeneau
dotnet new blazorwasm
.NET CLI command.-n
) of the project, and that we didn't want a restore. If you're to open the Pages/Counter.razor file, you'll see some Razor code similar to the following:@page "/counter"
<h1>Counter</h1>
<p>Current count: @_currentCount</p>
<button class="btn btn-primary"
@onclick="IncrementCount">
Click me
</button>
@code {
private int _currentCount = 0;
private void IncrementCount() =>
++ _currentCount;
}
@page
directive, which specifies the page route of "/counter"
. Since this is based on the Razor view engine, it serves as a template — where you can reference C# code variables in the HTML. This also demonstrates the use of the @code { ... }
directive, which lets you embed C# functionality directly within the template file. The _currentCount
variable is private
and scoped to the page, and incremented from the IncrementCount
method. This method is called from on the clicking of the button and is bound via the @onclick
event. As the _currentCount
value increments, the changes are reflected immediately where they're bound. In this case, they are displayed within a <p>
element as the "Current count".