Questions tagged [asp.net-blazor]

199 questions
14
votes
4 answers

How can I write into the browser´s console via Blazor WebAssembly?

In JavaScript we can use the following call to write debug output to the browser´s console: console.log("My debug output."); Output in Google Chrome: How can I log "My debug output" in my component to the browser´s console via Blazor…
Simon
  • 3,043
  • 1
  • 35
  • 66
13
votes
2 answers

how to call child component method from parent component in blazor?

i have two component. The first component includes list of model and the second component contains modal form I want to click on the model when inside the first component In the second component, open modal and edit the model how to call show…
reza malekmohamadi
  • 175
  • 1
  • 2
  • 7
12
votes
4 answers

Why is Azure SignalR Service recommended when deploying a Blazor Server Side app?

When I publish a Blazor Server Side app on Azure, Visual Studio prompts a message that says: Your application is making use of SignalR. For environments that need to scale we strongly recommend adding a dependency on Azure SignalR Service. However,…
11
votes
2 answers

Require authorization on ALL Blazor pages

I am playing with Blazor and created a web app that is server hosted. I have to put an authorize line on top of the page like this @attribute [Authorize] to ensure the user is logged in. It seems like I have to add this line to each page…
Franky
  • 445
  • 4
  • 13
11
votes
1 answer

How to render a Blazor component into an HTML string

I'm looking for a way to render a Blazor component into an HTML string, so that I'll be able to use it as a templating engine to create and send emails in my web application. Ideas?
8
votes
2 answers

How can I host ASP.NET API and Blazor Web Assembly like an JavaScript-SPA?

Context: We want to create a Single Page Application that runs with Blazor WebAssembly on the client-side. On the server-side, the solution has an ASP.NET MVC which includes some ApiController classes for our REST APIs. We want to use ASP.NET API…
7
votes
2 answers

Displaying the local machine camera feed in a Blazor Web Assembly app

I've distilled my issue down to a boilerplate Blazor Web Assembly app. The project is straight out of the wizard, with the below code added. I've changed the Index.razor page to this: @page "/" @inject IJSRuntime JSRuntime; @using…
Newbee
  • 143
  • 1
  • 7
7
votes
2 answers

When to use ValueChanged and ValueExpression in Blazor?

I'm seeing this common pattern in some libraries (MatBlazor, Telerik) of having ValueChanged and ValueExpression properties and it really confuses me. What is the difference between both? And when to use it?
Vencovsky
  • 17,142
  • 1
  • 46
  • 97
6
votes
2 answers

What is a Unit in terms of Azure Signal R Service?

So I've been going through Azure Signal R Service for blazor apps and I've noticed they have their pricing according to units as well. The free version allows up to one unit where as the standard version has up to 100 units. I'm currently clueless…
5
votes
2 answers

Best way to share data between two child components in Blazor

I have this code. @renderFragment where @renderFragment is dynamically…
4
votes
1 answer

When to have more than one root components in Blazor?

In the main method of dotnet core blazor web assembly app there is a WebAssemblyHostBuilder class which builds the host for the blazor application. In that class there is a public property called RootComponentMappingCollection which one can add the…
4
votes
1 answer

MediatR Notifications with Blazor (WASM) - Event handler does not update UI

I'm trying to hook up MediatR in a client-side Blazor application purely to handle event notifications between components. The event is published, and it gets picked up by a separate component with a handler, but I can't update the UI from the…
pfeds
  • 1,813
  • 4
  • 28
  • 42
4
votes
1 answer

How can I publish a blazor client/server app to a linux web server? Don't have access to ssh and dotnet publish doesn't give an index.html

I've built a blazor app that has no issues at the moment. When I call "dotnet publish -c Release" I get a published project, except the output is an executable file that ubuntu picks up as an octet-stream or something along the lines. If I run it,…
4
votes
2 answers

The assembly does not contain a public invokable method with [JSInvokableAttribute]

We use Blazor WebAssembly and I want to call an non-static method in my Index.razor-File by JavaScript. JavaScript: (function () { // keydown event window.addEventListener("keydown", function (e) { …
4
votes
0 answers

Blazor WebAssembly debug Program.cs

I've tried debugging in both vs code and vs.net 2019 and in both cases debugging everything bug Program.cs works. I'm trying to figure out why configuration isn't working but can't step into the code to see what's going on. Anyone know how to debug…
1
2 3
13 14