Questions tagged [asp.net-blazor]

348 questions
39
votes
5 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
  • 4,157
  • 2
  • 46
  • 87
38
votes
3 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
  • 507
  • 1
  • 8
  • 14
33
votes
3 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
  • 1,262
  • 2
  • 16
  • 31
26
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
  • 28,550
  • 17
  • 109
  • 176
20
votes
3 answers

Are generic type constraints possible in blazor?

How can I restrict TModel to be classes only or to be implementing a specific interface? @typeparam TModel cannot get the syntax working.
CleanCoder
  • 2,406
  • 1
  • 10
  • 35
20
votes
2 answers

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?
17
votes
4 answers

Blazor @page route url define with variable

I have a question for Blazor Server Side. I want to @page route url define with variable or property. I can use now with below default method @page "/route-url"

Page Test

@code { } But i want use like as below method @page…
muratoner
  • 2,316
  • 3
  • 20
  • 32
17
votes
1 answer

How to change the base URL of a blazor wasm app

The generated template for a blazor wasm hosted app has its base URL starting at '/' ( ie, https://localhost:5001/ for local development or https://www.domain-name.xyz/ when deployed.) I need this base URL to be '/app' instead, ie,…
16
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,…
14
votes
1 answer

Can you develop a webpage using .NET MAUI and blazor and target the web, ios, android and windows?

I have recently read up on .NET MAUI but I am confused about its purpose with Blazor. Can you develop a webpage using .NET MAUI and blazor and target the web, ios, android and windows? For example develop the web page effectively to also work as an…
User101
  • 748
  • 2
  • 10
  • 29
14
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…
12
votes
3 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) { …
12
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…
11
votes
1 answer

JavaScript interop Error when calling javascript from OnInitializedAsync Blazor

I am following a sample app from the NDC Oslo which is this app: https://github.com/SteveSandersonMS/presentation-2019-06-NDCOslo/tree/master/demos/MissionControl. This implements JWT as authentication and authorization. However when I tried to copy…
ECie
  • 1,265
  • 4
  • 21
  • 50
9
votes
1 answer

Is it possible to specify two different type param values for parent and child components in Blazor?

Please refer the following code blocks. For that code blocks, I have tried to access the parent component values into child component, but it always return the null value in child component.
SVB Ashok
  • 278
  • 1
  • 6
1
2 3
23 24