asp.net-blazor

Blazor format an InputType of Numeric

送分小仙女□ 提交于 2021-02-08 11:13:06
问题 Would anyone know how to format a Numeric type to look like 100.10? Currently if the value is 100.10 it will display as 100.1 tried @bind-value:format with C2, 0:0.##, I'm new to Blazor so if anyone could point me in the right direction it would be appreciated. <BSBasicInput InputType="InputType.Number" @bind-Value="@Amount" step="0.01" /> 回答1: If you bind to a decimal it seems it will keep the number of decimals you specify for the value, even training zeros. @page "/" <EditForm Model=

Blazor format an InputType of Numeric

会有一股神秘感。 提交于 2021-02-08 11:12:03
问题 Would anyone know how to format a Numeric type to look like 100.10? Currently if the value is 100.10 it will display as 100.1 tried @bind-value:format with C2, 0:0.##, I'm new to Blazor so if anyone could point me in the right direction it would be appreciated. <BSBasicInput InputType="InputType.Number" @bind-Value="@Amount" step="0.01" /> 回答1: If you bind to a decimal it seems it will keep the number of decimals you specify for the value, even training zeros. @page "/" <EditForm Model=

Blazor WebAssembly template not found in Blazor new project

只愿长相守 提交于 2021-01-28 05:36:52
问题 I have installed dotnet SDK 3.1.201 to Microsoft Visual Studio Professional 2019 Version 16.5.4 and I installed this template dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview5.20216.8 after that I statred to create a new Blazor project in VS just only contains the Blazor Server App template I didn't find the Blazor WebAssembly App template what is wrong with all steps that I have done. 回答1: I have the same problem when I tried to install the template, my

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

爷,独闯天下 提交于 2021-01-27 22:16:03
问题 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, it just opens the server on localhost:5000. Copying this to my web server through cpanel did nothing -- even trying to test out a generic blazor Wasm app and publishing it gave me an index.html, but it would never actually load anything when I

How to render a Blazor component into an HTML string

天大地大妈咪最大 提交于 2021-01-22 00:31:33
问题 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? 回答1: Yes, you can use the test library provided by Steve Sanderson and adapt it to your needs. This article explains how to use it : Introduction to Blazor Component Testing . The library can be use to generate the HTML of a component. exemple : var host = new TestHost(); var component = host.AddComponent

Are generic type constraints possible in blazor?

本秂侑毒 提交于 2020-12-23 13:00:23
问题 How can I restrict TModel to be classes only or to be implementing a specifix interface? @typeparam TModel cannot get the syntax working. 回答1: The solution is to additionally put the type constraint in a partial code behind class. It works! 来源: https://stackoverflow.com/questions/60714729/are-generic-type-constraints-possible-in-blazor

Are generic type constraints possible in blazor?

只愿长相守 提交于 2020-12-23 12:58:58
问题 How can I restrict TModel to be classes only or to be implementing a specifix interface? @typeparam TModel cannot get the syntax working. 回答1: The solution is to additionally put the type constraint in a partial code behind class. It works! 来源: https://stackoverflow.com/questions/60714729/are-generic-type-constraints-possible-in-blazor

Are generic type constraints possible in blazor?

别说谁变了你拦得住时间么 提交于 2020-12-23 12:58:53
问题 How can I restrict TModel to be classes only or to be implementing a specifix interface? @typeparam TModel cannot get the syntax working. 回答1: The solution is to additionally put the type constraint in a partial code behind class. It works! 来源: https://stackoverflow.com/questions/60714729/are-generic-type-constraints-possible-in-blazor

Are generic type constraints possible in blazor?

删除回忆录丶 提交于 2020-12-23 12:55:40
问题 How can I restrict TModel to be classes only or to be implementing a specifix interface? @typeparam TModel cannot get the syntax working. 回答1: The solution is to additionally put the type constraint in a partial code behind class. It works! 来源: https://stackoverflow.com/questions/60714729/are-generic-type-constraints-possible-in-blazor

Are generic type constraints possible in blazor?

对着背影说爱祢 提交于 2020-12-23 12:55:33
问题 How can I restrict TModel to be classes only or to be implementing a specifix interface? @typeparam TModel cannot get the syntax working. 回答1: The solution is to additionally put the type constraint in a partial code behind class. It works! 来源: https://stackoverflow.com/questions/60714729/are-generic-type-constraints-possible-in-blazor