blazor

Mat Blazor mat-expansion-panel remove elevation/border

为君一笑 提交于 2020-02-16 06:29:20
问题 I want to remove the elevation/border from Mat expansion panel. I've already read other related articles like mat-expansion-panel remove border but they are not working within Blazor. I've tried to access the background-color property but MatBlazor is saying this property doesnt exist. I've also tried using the class=".mat-elevation-z0" inside the Mat Expansion panel like this: <MatExpansionPanel class=".mat-elevation-z0" @bind-Expanded="@panelOpenState"> Which Doesn't work. At the minute the

How make window.history.go(-1) from Blazor c# code?

本小妞迷上赌 提交于 2020-02-08 10:27:24
问题 How make window.history.go(-1) from c# code on Blazor? I tried to use JSRuntime.Current.InvokeAsync JSRuntime.Current.InvokeAsync< string >( "history.go", new[] {-1} ); JSRuntime.Current.InvokeAsync< string >( "top.history.go", new[] {-1} ); JSRuntime.Current.InvokeAsync< string >( "window.history.go", new[] {-1} ); JSRuntime.Current.InvokeAsync< string >( "window.top.history.go", new[] {-1} ); but I get the error: go called on an object that does not implement interface History. But it work

How make window.history.go(-1) from Blazor c# code?

♀尐吖头ヾ 提交于 2020-02-08 10:26:54
问题 How make window.history.go(-1) from c# code on Blazor? I tried to use JSRuntime.Current.InvokeAsync JSRuntime.Current.InvokeAsync< string >( "history.go", new[] {-1} ); JSRuntime.Current.InvokeAsync< string >( "top.history.go", new[] {-1} ); JSRuntime.Current.InvokeAsync< string >( "window.history.go", new[] {-1} ); JSRuntime.Current.InvokeAsync< string >( "window.top.history.go", new[] {-1} ); but I get the error: go called on an object that does not implement interface History. But it work

Error after updating visual studio 2019 preview

时光毁灭记忆、已成空白 提交于 2020-02-07 04:03:05
问题 Getting an error in IE console while loading Blazor application after updating Visual Studio 2019 Preview 1 to Preview 2 Error: Microsoft.JSInterop.JSException: iconRef is not defined ReferenceError: iconRef is not defined 回答1: When deleting all the browsing data like cookies, cache extra the issue is resolved. 来源: https://stackoverflow.com/questions/57609202/error-after-updating-visual-studio-2019-preview

Blazor component : refresh parent when model is updated from child component

天大地大妈咪最大 提交于 2020-02-05 04:28:04
问题 I'm using Server-side Blazor components in ASP.NET Core 3 preview 4. I have a parent component, and child components, using the same shared model, like this : Model : public class CountModel { public int Count { get; set; } public void Increment() { Count++; } } Parent component : @page "/count" <CascadingValue Value="currentCount"> <h1>Count parent</h1> <p>Current count is : @currentCount.Count</p> <button class="btn btn-primary" onclick="@currentCount.Increment">+1 from parent</button>

How to obtain the target element on click event in Blazor

烈酒焚心 提交于 2020-02-03 11:02:09
问题 I want the exact target on which the click event has been triggered in ASP.NET Core blazor. Is this achievable? 回答1: You can use @ref to get a reference to a DOM object, then pass it as a parameter to your handler function. You can then pass it as a parameter to the JS Interop. For example: Counter.razor @page "/counter" @using Microsoft.JSInterop @inject IJSRuntime JSRuntime <h1>Counter</h1> <p>Current count: @currentCount</p> <p>Last button clicked: @lastButtonClicked</p> <button @ref

How to redirect to Blazor with token

自作多情 提交于 2020-02-02 13:14:20
问题 I have a Middleware which performs an authentification and should then reroute to a Blazor web application. The problem is that I get the token put in the request query and I want it in the body of the request. Middleware: public async Task Invoke(HttpContext context) { string token = context.Request.Query["token"]; if (!context.User.Identity.IsAuthenticated) { //do some logic to authenticate } else await this.next(context); } Configure: public void Configure(IApplicationBuilder app,

Razor Pages vs server-side Blazor

99封情书 提交于 2020-02-02 12:56:07
问题 Razor Pages is used for server side web applications, just like in the good old days. Blazor is aiming to provide an alternative to popular JavaScript frameworks (like Angular or React), to create Single Page Applications (SPAs) which runs (mainly) in the clients browser. However, I have also heard about server-side Blazor, which kind of confuses me. According to this answer, server side Blazor is just Razor Components running on the server. But what is the difference between Razor Pages and

Missing visual studio 2019 blazor webassembly app template

给你一囗甜甜゛ 提交于 2020-02-02 03:57:27
问题 I update my vs 2019 16.3.10 to 16.4 and .net core 3.0 to .net core 3.1 but blazor webassembly app template is missing. 回答1: Try the following to install the latest Blazor WebAssembly template. Run the following command: dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.1.0-preview2.19528.8 Get the latest version here. It's free... 来源: https://stackoverflow.com/questions/59272624/missing-visual-studio-2019-blazor-webassembly-app-template

Blazor - razor page not updating after property from DI Service is changed

风格不统一 提交于 2020-01-30 07:49:07
问题 Using dotnet 3.1.100-preview2-014569 Ok consider the following example: Create a new Blazor WebAssemply project from template, then add the following: books.razor @page "/books" @inject BookService bookService @if (bookService.isLoaned) { <p><em>Book loaned</em></p> } else { <p><em>Book returned</em></p> } BookService.cs public class BookService { public int BookId { get; set; } public string Title { get; set; } public bool isLoaned { get; set; } } Startup.cs public void ConfigureServices