Questions tagged [blazor]
Blazor lets you build interactive web UIs using C# instead of JavaScript. It is a feature of ASP.NET, the web development framework from Microsoft that extends the .NET developer platform.
8,470
questions
0
votes
0
answers
4
views
MudTextField sends HTTP request at every keystroke
I use the MudTextField for a login form. Whenever a user types something into the text field the application sends the current state to the server.
Example:
<MudTextField Label="Username" ...
0
votes
1
answer
21
views
How to run MAUI Blazor App in a web browser?
How can I run a MAUI Blazor App in a web browser?
I've used the VS MAUI with Blazor sample project
0
votes
0
answers
20
views
Read in file in Blazor
I'm using blazor webassembly and I want my model to read a .tsv or .csv file from my sample-data folder. I know that I can use
protected override async Task OnInitializedAsync()
{
fileName ...
0
votes
0
answers
21
views
Access individual items in Blazor Virtualized list
I have a simple collection of "Conversation" like this:
public class Conversation
{
public string? contactName { get; set; }
public string? thread { get; set; }
public DateTime ...
0
votes
0
answers
17
views
JSON cloning of DTO not working as expected
In continuation of this post I face a problem when cloning an object by serializing/deserializing it with Newtonsoft.Json.
The purpose:
From a list of ItemView's I'm passing a ItemView parameter to a ...
0
votes
2
answers
45
views
How to reset model in Blazor form?
In my Blazor app I have a list of items. Clicking one of the items will open a dialog component with the item as a parameter. Within the dialog is an EditForm:
<div class="modal-container"...
0
votes
2
answers
39
views
Blazor List of components, shift values from components when removed from list
I'm trying to understand this issue I'm having in blazor 3.1 and appreciate anyone who could explain it to me.
I have a list of items.
I make child components by iterating through the list.
Each ...
0
votes
0
answers
24
views
How Can I Retrieve an Image Stream From 3rd Party Site in Blazor WASM? [closed]
We are trying to build an image editor in Blazor WASM.
The source image is a 3rd party site, so when we use HttpClient to retrieve the data, we are hit with a CORS error.
So, we setup a "proxy&...
0
votes
1
answer
26
views
Scaffolding Layout file for Identity in .Net 6.0
When scaffolding Identity Pages for a .Net 6.0 project the Layout page does not get scaffolded.
I tried scaffolding via UI in Visual Studio, and via the command line:
dotnet aspnet-codegenerator ...
0
votes
2
answers
26
views
JsonConverter - WebApi - Case Sensitivity - Polymorphic
I'm using a JsonConverter to deal with a polymorphic collection:
class ItemBatch
{
List<ItemBase> Items { get; set; }
}
// For type discrimination of ItemBase
class ItemTypes
{
public ...
0
votes
1
answer
23
views
Dynamic Menus Binding in mud blazor Navigation Menu component
I'm trying to use a foreach loop in a MudBlazor Nav menu component.
<MudNavMenu>
@{
if (dtX != null && dtX.Rows.Count > 0)
{
...
1
vote
2
answers
43
views
Blazor WASM - StateHasChanged() Not Updating UI
I'm using Blazor WASM on .NET6. I'm trying to filter names of links on a mega menu.
I have my reactive filter which is a html input, and based on the text entered in the input, if any text is matching ...
0
votes
0
answers
35
views
Keeping Data between refreshes in Blazor server
I have a multiple page Web Application that needs to be refreshed after a user has entered in data to then display the data on the table. I have Scoped dependencies so my users do not see the same ...
0
votes
2
answers
27
views
One line If statement in Razor not working
This statement outputs the the HTML exactly, my intent is for it the be rendered as HTML.
<td>@(part.IsVocal ? "<span class='badge bg-success'>Yes</span>" : "<span ...
1
vote
1
answer
36
views
The JSON value could not be converted to Model Blazor
First Blazor WASM app. I get an error while fetching data from Server:
System.Text.Json.JsonException: Deserialization failed for one of these reasons:
Invalid property 'result' found within a JSON ...
0
votes
0
answers
25
views
.net maui blazor hybrid MSAL authentication
I am trying to get authentication working though .net maui blazor for Android,
I have set up the manifests to correctly bounce off the AAD and i can get logged in and get my id from azure, the issue ...
-2
votes
0
answers
17
views
How to set the properties on a dxcombobox?
I am using dxcombobox which a DevExpress ComboBox for Blazor. I want my dropdown to be autocompleted when a user inputs a letter. Is there a way to edit the properties in dxcombobox? There are many ...
0
votes
1
answer
42
views
generate blazor mudblazor table dynamicly
i would like to build some dynamic table component based on 'MudTable' but so as i using reflection not need to define column list.
so i have DynamicTableComponent.razor
@using System.Reflection
@...
0
votes
0
answers
18
views
How to: Update Management on server-side PWA
I have an self-contained Blazor app running on a server for different graphs and overviews.
If I update my server and I have added a new .js or .css or I modify a .dll, the client sometimes does not ...
0
votes
0
answers
9
views
Blazor Webassembly Core Hosted Debugging not working
I have built a WebApp based on Blazor in my company. However, I am not able to debug. The breakpoints are not bound. A call to chrome --remote-debugging-port=9222 --user-data-dir="C:\Users\marco....
0
votes
0
answers
22
views
Health check ui authorization in blazor
I have added xabari health check ui in my application. Now I need to authorize it but can not find a way to do it.
'''
Endpoints.maphealthcheckui(). requireauthroization
'''
I am using local storage ...
1
vote
0
answers
40
views
Blazor foreach with async method [duplicate]
A razor page is currently constructing a page like this:
@*...*@
<Template>
<Items>
<Foo />
@foreach (var pin in Helper.GetPins()) {
@*... using pin in control with ...
0
votes
0
answers
16
views
Unable to return C# type to Javascript method. Blazor WASM
I have a method in my component which I am invoking from javascript, it works fine if I return a string but if I return my class object, the Javascript method doesn't continue.
[JSInvokable]
public ...
0
votes
0
answers
25
views
Separate instances of my component are unexpectedly sharing the event handler when searching
I have created a custom component (Searchable Dropdown) which is supposed to take in a List of some items that adhere to the "SearchableDropdownItem" interface and then allow the user to ...
0
votes
0
answers
16
views
How to do validation for a Custom Blazor multiple select component? Error: MultipleSelect requires a value for the 'ValueExpression' parameter
I am working to create a custom Blazor multiple select component. It works until I add the validation. Also if I disable multiple select and leave the validation on, it works.
When multiple select ...
0
votes
1
answer
10
views
Is it possible to learn and use Blazor without prior knowledge or experience with Razor?
Intent is to add a UI to an existing web api implemented in Net5. I thought of blazor as it enables real time updates to the client. However as I am trying to learn blazor, there doesnt seem to be a ...
0
votes
2
answers
33
views
Update script for SQL
I have a Blazor app that I used the following command to create the database.
dotnet ef migrations script
The problem is the script generated is only good for a first time database with nothing in it....
0
votes
3
answers
33
views
How can I inject a service into an Entity Framework AddDbContextFactory lambda function in Blazor Server?
In Blazor server, how can I inject a scoped service into the lambda below so that I can read the authenticated user and select a SQL connection string based on the user.
builder.Services....
0
votes
2
answers
38
views
Passing method as parameter in blazor
I'm passing a method from a parent Blazor component into a child.
The parent definition looks like:
public bool AddOrUpdate(MyModel myModel)
{
// do stuff
return true;
}
In the ...
0
votes
1
answer
26
views
Why is bUnit telling me it cannot "click" a button because the element does not have an event handler for onclick, even though it does?
This is the element as it looks in its .RAZOR page:
<button id="@(theID)" type="button" class="btn btn-primary" onclick="window.open('https://www.google.com/');&...
0
votes
0
answers
21
views
When a user enters a letter, how to automatically select the value starting with the letter dropdown?
<DxComboBox ReadOnly=@BDisableSearch Data="Data" SizeMode="SizeMode.Small"
FilteringMode="DataGridFilteringMode.Contains" AllowUserInput="false" ...
0
votes
0
answers
22
views
Blazor ErrorBoundary not displaying/triggering for exceptions within an async call
I've added <ErrorBoundary> around the @Body within my Shared/MainLayout.razor file, yet when an error occurs in an async method the default blazor-error-ui element in Pages/_Layout.cshtml is ...
0
votes
1
answer
34
views
How to change dynamically a blazor component
I need to change the items from a list, the list is a component that shows numbers, but its numbers depend from other component named component2, and if component2 change her value component1 should ...
0
votes
2
answers
54
views
I got Error An unhandled exception occurred while processing the request
i'm newly learning ASP.net Core and i got this error :
I have been searching the solution i internet but didn't get any result. Can anyone help me? this is my code:
Details.cshtml
@model SixthApp....
0
votes
0
answers
29
views
How to display received data or value in Blazor webassembly?
I have this problem: I can send data or a value to a function from a page or an API but razer component doesn't show the value; actually, it doesn't render new values.
Here's my example function:
...
-2
votes
0
answers
17
views
How to trigger a method when a radio option is selected in MudBlazor?
I have a Blazor component with MudBlazor MudRadioGroup with multiple options. I want to trigger a method in code-behind when one of those options is selected by the user. I see that onchange or ...
0
votes
1
answer
28
views
Blazor App get data from external API on local machine
I have built a fairly simple API, which is running on IIS on my local machine. It works fine. I then put an Ocelot gateway in front of it, which also works fine. I now have a Blazor app that is ...
0
votes
0
answers
21
views
Blazor generic component - unknown prop
this is my search metod in generic component:
private ICollection<TItem> GetItems(string text)
{
return DataToSearch.Where(x => x.ToString().ToUpper().Contains(text.ToUpper())).ToList();
...
0
votes
1
answer
44
views
What ist the difference between ontouchend and ontouchleave?
It seems like for the following question Google should give an answer but (for me) it doesn't.
What ist the difference between the events ontouchend and ontouchleave or ontouchstart and ontouchenter, ...
0
votes
1
answer
31
views
SignalR Hub in a Blazor Server App with Windows Authentication on Windows 2019 IIS 10 not working
What i've done:
blazor server app template with VS 2022 + .Net6.0 with Windows Authentication
add a simple Hub
host the application on Windows Server 2019 + IIS 10
(btw all is working when Hosting ...
0
votes
1
answer
23
views
Blazor Server App with Dynamic CultureInfo Saved in Cookie don't work in iFrame
I can't share my own app for nda issue but I found this one which shows exactly the same issue
https://github.com/SyncfusionExamples/blazor-localization/tree/master/.NET6%20Blazor%20Server%20App/...
1
vote
0
answers
33
views
Improving Blazor rebuild speeds
When making changes to my Blazor server project, which is quite massive now, the rebuild takes approximately 30 seconds. In some cases, this is serving as an impediment to productivity. Hot reload is,...
0
votes
1
answer
20
views
Create href to subpage in Blazor
My page has this directive @page "/sales/reports" so it loads at https://localhost/sales/reports route.
I want to create link <a href="">Report 1</a> that will lead to ...
0
votes
1
answer
36
views
Register event from blazor component into razor page
I have a razor page project where I want to include a composant from a blazor client project. The two project are in dotnet 6.
I manage to have the composant working and to pass some value to it (via ...
0
votes
1
answer
40
views
Unhandled exception rendering component: '<' is an invalid start of a value
just started with Blazor created my first app its a CRUD app with api. But i get this huge error and i can't figure out what is wrong and what it actual means? think something with the api links? I've ...
-1
votes
1
answer
43
views
List<string> differ from cs to blazor page
I have a dictionary of string and object, and I am filling it with same values in cs class and in a blazor page:
Blazor page and Cs class:
ExportOptions exportOptions = new();
exportOptions.Options = ...
1
vote
1
answer
25
views
How to read headers on Blazor Razor Page?
I have a Razor Page and want to read headers from requests, but I can't to find how to do it.
How can I do it?
@page "/"
@inject NavigationManager navigationManager;
<div class="...
0
votes
0
answers
27
views
How do I Authenticate with Google on a Blazor page
I want to Authorise an action with google, in this case listing the YouTube Videos from that google account on a Blazor page.
If I try this code it just throws an error
Error: System....
0
votes
0
answers
9
views
How can I link a custom function to a ChartJs via Blazor?
I'm working on a facade for ChartJs for Blazor (see GitHub). What I like to do is add JavaScript function to extend ChartJs. I don't know how to link a function in the UI side with the JavaScript in ...
0
votes
1
answer
55
views
SignalR with Azure AD (Blazor Server chat app)
https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-tutorial-build-blazor-server-chat-app
How do I get this to work with Azure AD activated? It works perfect when I run in locally in visual ...