Blazor Textfield Oninput User Typing Delay

Solution: There is no single solution to your question. The following code is just one approach. Take a look and adapt it to your requirements. The code resets a timer on each keyup, only last timer raises the OnUserFinish event. Remember to dispose timer by implementing IDisposable @using System.Timers; @implements IDisposable; <input type=”text” @bind=”Data” @bind:event=”oninput” … Read more

Is there an equivalent to Html.Raw in Blazor?

Feature to render raw HTML was added in Blazor 0.5.0 version. This is the example of how raw HTML can be rendered from string containing HTML content: @((MarkupString)myMarkup) @functions { string myMarkup = “<p class=”markup”>This is a <em>markup string</em>.</p>”; } More info can be found in “Blazor 0.5.0 experimental release now available” announcement.

How to use Bootstrap modal in Blazor client app?

There is likely a better way to do this, but here’s a working example to get you started: Page: @page “/modal-test” <BlazorApp1.Components.Modal @ref=”Modal”></BlazorApp1.Components.Modal> <button @onclick=”() => Modal.Open()”>Open Modal</button> @code { private BlazorApp1.Components.Modal Modal { get; set; } } Component: <div class=”modal @ModalClass” tabindex=”-1″ role=”dialog” style=”display:@ModalDisplay”> <div class=”modal-dialog” role=”document”> <div class=”modal-content”> <div class=”modal-header”> <h5 class=”modal-title”>Modal title</h5> … Read more

How to map fallback in ASP .NET Core Web API so that Blazor WASM app only intercepts requests that are not to the API

To recap the problem, when somebody makes a request to: https://yourapp.com/api/someendpoint and /api/someendpoint can’t be found, they’re taken to a Blazor page. This default behaviour is weird. For requests starting with /api, they were expecting an HTTP Status Code and probably a JSON object too, but instead, they got HTML. Maybe they don’t even use … Read more