Create Cascading Dropdowns with Blazor in .NET 8 🔥
ฝัง
- เผยแพร่เมื่อ 1 ธ.ค. 2024
- 🚀 Join the .NET Web Academy: dotnetwebacade...
🎉 Grab a massive discount by using the code "DOTNET9".
💖 Support me on Patreon for exclusive source code access: / _patrickgod
🚀 Get the .NET 8 Web Dev Jump-Start Course for FREE: dotnet8.patric...
#DotNet #Blazor #AspNetCore
Thanks. Input select really grinds my gears 😂
Well done!
10:35 - IJSRuntime : To Interop with javascript
15:40 @bind:after
Thanks for the @bind:after trick, I always did @onchange and nothing else.
I have used the same @bind:after, but my code is WASM. The event is not triggered,. no error message in the browser trace. can you please advise?
Thanks Patrick for that awesome video.
When preferred creating a single component for Create and Edit an item over creating separate components for each one? and vice versa
Nice video but you at around 14:20 in the video you incorrectly mentioned that you cannot do anything with like have an event fire OnInputSelected() - You can easily do it as shown below:
You
@if (languages is not null)
{
@foreach (var language in languages)
{
@($"{language.Name} ({language.Name})")
}
}
@code {
private async Task OnLanguageChanged(ChangeEventArgs e)
{
var Value = e.Value.ToString();
Model.LangaugeCode = Value;
SelectedInputLanguage = languages.FirstOrDefault(p => p.Code == Value);
// Other code as required
}
}
The trick is to use @oninput="OnInputLanguageChanged" and use "ChangeEventArgs e" in the Method e.g. private "async Task OnInputLanguageChanged(ChangeEventArgs e)"
Hope that helps 🙂
Man thanks you, i dont know but im using form or editform and when I send the form to the using just one field send the correct data the others don't but with work, but I was using @onchange event caller and never hit my evet. thanks you and if you can give me any advice on why only one of the 3 update the data to the object.
Super great tutorials,we want to see the next on editform
If you add a button that removes a platform will the dropdowns update automatically? As in 2 way binding sense ?
How can you remove the highlighting in code? And how do you leave the attributes in purple?
You need to go Options > Fonts and Colors
From there you can change the color, highlighting, background color,text color for each and every screen / text.
Muito obrigado!
I never knew about the @bind:after attribute, I feel so foolish for not knowing about it sooner! I've had to resort to really weird things like manually implemented properties with a custom setters, in my case
private int _selectedColaDetailId;
public int SelectedColaDetailId
{
get { return _selectedColaDetailId; }
set
{
if (_selectedColaDetailId != value)
{
_selectedColaDetailId = value;
HandleSelectedColaDetailIdChange(value);
}
}
}
Good video bro
Tus videos y cursos estan chevres. El detalle es el idioma. Podrías traducirlo al español????
Why don't we use DBContext instead of Services ?
The databse might change in production, services allow decoupling.
@@martingrof1685
Does using Dbcontext affect performance?
Nice tutorial, but still have trouble accepting Blazor. I'd prefer MVC and Javascript all day over Blazor. I can see Microsoft getting rid of Blazor in the next few years, then what?