All posts with Tag Blazor

Preview image blogpost

An awaitable Blazor Modal Dialog

I already showcased a simple modal dialog in a previous post. However, the dialog was not awaitable. In this post, I'll show you how to create an awaitable modal dialog.

Read the whole article

Preview image blogpost

bUnit v2 - The Blazor unit testing library vNext

Next to the big release of .NET 8, we also released the first preview bUnit v2. This release is a major release, with a lot of new features and improvements. In this post, I will highlight some of the most important changes. This includes new features but also some breaking changes.

Read the whole article

Preview image blogpost

bUnit Generators - Generate your stubs automatically

We made a recent addition to bUnit that we think will make your life easier. We call it bUnit Generators. It's a set of code generators that will help you create stubs for your third-party components.

Read the whole article

Preview image blogpost

Blazor .NET 8 - Enhanced Form Navigation

There are many new cool features with .NET 8 and Blazor in particular. In this blog post, I want to highlight a feature that I believe is very useful in the new context Blazor is living.

Read the whole article

Preview image blogpost

Redux Pattern in Blazor

In this blog post, we will use the Redux pattern with a small Blazor application. To demonstrate the inner workings, we will built everything from scratch.

Read the whole article

.NET 8 and Blazor United / Server-side rendering

New .NET and new Blazor features. In this blog post, I want to highlight the new features that are hitting us with .NET 8 in the Blazor world. So let's see what's new.

Read the whole article

Preview image blogpost

Creating a ToolTip Component in Blazor

In this blog post we will create a ToolTip component in Blazor from scratch. We will use the Blazor WebAssembly template to create a new project. We will then add a ToolTip component to the project and use it in the Index page. We will also add some styling to the ToolTip component.

The advantage over using a library is that we can customize the component to our needs as well as keeping it simple! So let's get started!

Read the whole article

Preview image blogpost

Blazor Project Structure

Did you ever wonder what is a nice way of structuring your Blazor application?

I will show you how I structure my Blazor projects (as well as this very blog). What are the upside in contrast to the "default" structuring you get with the Blazor template.

Read the whole article

Preview image blogpost

Blazor Client - Loading Screen

If you are using Blazor WebAssembly aka client-side Blazor you are faced with an issue: The .NET runtime including your assemblies has to be downloaded first. We are taking about some megabytes as the initial load.

Depending on the connection of your client there is a time where basically nothing happens. The default template just has a simple "Loading..." text. So let's change that.

Read the whole article

Preview image blogpost

When does Blazor (not) render?

This blog post whill shed some light on when Blazor renders your content. Of course there are obvious candidates, but there are also some things to be aware about.

Read the whole article

Preview image blogpost

Blazor with an RSS Feed

If you use a public Blazor Server application (like this blog is) and you want to expose an RSS Feed (I know kind of old school) you can perfectly do that with Blazor Server and a little help from a nuget package from Microsoft. Furthermore this guide is not only valid for Blazor but every ASP.NET Core endpoint.

Read the whole article

Preview image blogpost

Blazor with CancellationToken support

What happens when a user navigates away and still has a pending request to our server? Or what happens if we have a request which might take forever and wastes our resources?

Let's tackle these problems with a CancellationToken.

Read the whole article

Preview image blogpost

Modal Dialog component with Bootstrap in Blazor

This short blog post will show you how to utilize Bootstrap to create a small and reuseable ModalDialogComponent.

Read the whole article

Reusable loading Bar Component in Blazor

In our Blazor components we often call a repository or web API which takes some time. So it is nice to indicate to an user what the current state is. That is why we will create a small indicator even with steps to indicate how far we are in the progress.

Read the whole article

Preview image blogpost

RequiredIf - Extend the validation in Blazor

Just imagine you have your beautiful model in a form. And Blazor is very kind and does validation for you. It is really straight forward because you can annotate your model with some attributes like RequiredAttribute to tell Blazor: "Hey this property has to be set, otherwise the form will not be submitted."

But what if you want to have that easy setup with attributes but also want to say to Blazor: "Hey this property has to be set, if the other property is true.* Well, that does not work out of the box. So let's make it together!

Read the whole article

Preview image blogpost

Blazor Performance Tuning - Good practices and advanced use cases

Blazor is a beautiful framework for building SPA's. One advantage is that those SPA's feel like native applications. We do not feel that stuff is necessarily loading. But for that we have to keep our code performant.

This guide will highlight some of the techniques to keep your Blazor app running smoothly. We will also cover some more advanced use cases.

Read the whole article

Preview image blogpost

Prerendering Blazor Apps - How does it work / tips and tricks

Blazor comes with the option to prerender your webpage on the server. This works for the client-side version as well as the server side version of Blazor.

Let's have a look how does it work and what might be some pitfalls and how can we come around those.

Read the whole article

Preview image blogpost

Lazy load components with Blazor - Virtualize in Action

Since .NET5 we have the ability to "virtualize" a component.

But what exactly is that and how do we use it? This blog post will show you a lot of details about the <Virtualize> tag.

Read the whole article

Preview image blogpost

Lifetime Scope in Blazor Client and Server Apps

You probably are well aware of the Lifetime Scope for ASP.NET Core website. There are basically 3 scopes: Transient, Scoped and Singleton. Let's have a look how they differ in Blazor Client and Server.

Read the whole article

Preview image blogpost

Tutorial Unit and E2E Testing in Blazor - Part 2 Playwright Introduction

This time we will have a look at end to end testing. For this we are using the Playwright C# library from Microsoft. This is the second part of the series. Go here for Part 1

Read the whole article

Tutorial Unit and E2E Testing in Blazor - Part 1

This blog post should give you an easy and good introduction how to unit and end-to-end test your Blazor Application. Furthermore it does not matter if we are running server side or client side aka WebAssembly. The main two libraries we are using is first bUnit for unit-testing and Playwright for end-to-end testing. So let's dive in!

Read the whole article

Blazor Improvements in .NET 6

With .NET6 there is a lot to come what makes ASP.NET Core and especially Blazor better and more usable. In this article I will show some things which will definitely come (like AoT Compilation) and some things which might come (native Drag'n Drop support). Overall I feel .NET6 will be a big release which polishes the .NET Environment. Very looking forward.

Read the whole article

Preview image blogpost

My first Post

Welcome to my blog and my first post

In this article I will show you why I created my own blog-software from scratch and why I have a blog in the first place. Short answer: I like to know how to create a blog and I like blazor. Long answer you will find in the post.

Read the whole article

An error has occurred. This application may no longer respond until reloaded. Reload x