blazor-client-side

Blazor client-side debugging

ぃ、小莉子 提交于 2020-08-02 06:15:25
问题 I noticed that all of my C# breakpoints do not get hit as debugging seems like its disabled for client-side Blazor apps. Is there a way to attach the debugger or enable the debugger somehow? Thanks 回答1: Update : For those running .NET Core 3.2 preview 3 and above, please refer to this answer For those who like some pictures, here's a step by step using Visual Studio 16.4 preview (.NET Core 3.1 preview 2) & Chrome version 78. Start up the app using a debug profile . E.g. After site loads , and

Blazor client-side debugging

拥有回忆 提交于 2020-08-02 06:15:06
问题 I noticed that all of my C# breakpoints do not get hit as debugging seems like its disabled for client-side Blazor apps. Is there a way to attach the debugger or enable the debugger somehow? Thanks 回答1: Update : For those running .NET Core 3.2 preview 3 and above, please refer to this answer For those who like some pictures, here's a step by step using Visual Studio 16.4 preview (.NET Core 3.1 preview 2) & Chrome version 78. Start up the app using a debug profile . E.g. After site loads , and

How to use Bootstrap modal in Blazor client app?

假如想象 提交于 2020-07-29 06:44:18
问题 I am trying to show bootstrap modal then bind its buttons. But I cannot pass the first step showing the modal. I am using Blazor client template of .net core 3.1. I have a page named Modal.razor which contains the bootstrap modal I found from getbootstrap.com. @if (Show) { <div class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">Modal title</h5> <button type="button" class="close"

Blazor client-side Application level exception handling

蓝咒 提交于 2020-07-20 10:52:09
问题 How to globally handle application level exceptions for client-side Blazor apps? 回答1: You can create a singleton service that handles the WriteLine event. This will be fired only on errors thanks to Console.SetError(this); public class ExceptionNotificationService : TextWriter { private TextWriter _decorated; public override Encoding Encoding => Encoding.UTF8; public event EventHandler<string> OnException; public ExceptionNotificationService() { _decorated = Console.Error; Console.SetError

Blazor TwoWay Binding on custom Component

馋奶兔 提交于 2020-07-15 12:15:28
问题 I'm creating a blazor server side app and have problems to bind a value between two custom components. I've looked through different example of how the bind or @bind is supposed to work but I cannot figure out what up to date information on this matter is. Given a model class User: public class User { [Mapping(ColumnName = "short_id")] public string ShortId { get; set; } public User() { } } I want to build a form which displays all properties of this user and has them in an input so it can be

Blazor TwoWay Binding on custom Component

寵の児 提交于 2020-07-15 12:12:42
问题 I'm creating a blazor server side app and have problems to bind a value between two custom components. I've looked through different example of how the bind or @bind is supposed to work but I cannot figure out what up to date information on this matter is. Given a model class User: public class User { [Mapping(ColumnName = "short_id")] public string ShortId { get; set; } public User() { } } I want to build a form which displays all properties of this user and has them in an input so it can be

Blazor preventDefault on submit form

我的未来我决定 提交于 2020-07-10 02:53:23
问题 Inside my EditForm , I want to prevent that the user submits the form by pressing the Enter key. I have tried the following, but didn't work. <button type="submit" @onkeypress:preventDefault>Save</button> Many thanks! 回答1: I have got this working by just putting 2 submit button's in the EditForm , with the first one disabled. <button type="submit" disabled style="display: none" aria-hidden="true"></button> <button type="submit">Save</button> 回答2: Here's a working code sample, run it and see

Blazor preventDefault on submit form

梦想的初衷 提交于 2020-07-10 02:53:18
问题 Inside my EditForm , I want to prevent that the user submits the form by pressing the Enter key. I have tried the following, but didn't work. <button type="submit" @onkeypress:preventDefault>Save</button> Many thanks! 回答1: I have got this working by just putting 2 submit button's in the EditForm , with the first one disabled. <button type="submit" disabled style="display: none" aria-hidden="true"></button> <button type="submit">Save</button> 回答2: Here's a working code sample, run it and see

Blazor preventDefault on submit form

余生长醉 提交于 2020-07-10 02:52:28
问题 Inside my EditForm , I want to prevent that the user submits the form by pressing the Enter key. I have tried the following, but didn't work. <button type="submit" @onkeypress:preventDefault>Save</button> Many thanks! 回答1: I have got this working by just putting 2 submit button's in the EditForm , with the first one disabled. <button type="submit" disabled style="display: none" aria-hidden="true"></button> <button type="submit">Save</button> 回答2: Here's a working code sample, run it and see

Blazor preventDefault on submit form

别说谁变了你拦得住时间么 提交于 2020-07-10 02:52:24
问题 Inside my EditForm , I want to prevent that the user submits the form by pressing the Enter key. I have tried the following, but didn't work. <button type="submit" @onkeypress:preventDefault>Save</button> Many thanks! 回答1: I have got this working by just putting 2 submit button's in the EditForm , with the first one disabled. <button type="submit" disabled style="display: none" aria-hidden="true"></button> <button type="submit">Save</button> 回答2: Here's a working code sample, run it and see