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

ความคิดเห็น • 20

  • @adrianspikes6454
    @adrianspikes6454 5 หลายเดือนก่อน +2

    Thanks. Input select really grinds my gears 😂

  • @miyu545
    @miyu545 7 หลายเดือนก่อน

    Well done!

  • @ivandrofly
    @ivandrofly 22 วันที่ผ่านมา

    10:35 - IJSRuntime : To Interop with javascript
    15:40 @bind:after

  • @imSkod
    @imSkod 7 หลายเดือนก่อน +6

    Thanks for the @bind:after trick, I always did @onchange and nothing else.

  • @izureiki
    @izureiki 2 หลายเดือนก่อน

    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?

  • @Tamer_Ali
    @Tamer_Ali 7 หลายเดือนก่อน

    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

  • @saroshwadia
    @saroshwadia 7 หลายเดือนก่อน +3

    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 🙂

    • @criticando2882
      @criticando2882 4 วันที่ผ่านมา

      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.

  • @yinkaadeniyi573
    @yinkaadeniyi573 7 หลายเดือนก่อน

    Super great tutorials,we want to see the next on editform

  • @unskeptable
    @unskeptable 7 หลายเดือนก่อน

    If you add a button that removes a platform will the dropdowns update automatically? As in 2 way binding sense ?

  • @felipemorales6539
    @felipemorales6539 7 หลายเดือนก่อน

    How can you remove the highlighting in code? And how do you leave the attributes in purple?

    • @imashar
      @imashar 7 หลายเดือนก่อน +1

      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.

  • @djalmaalmeidafeitosa9144
    @djalmaalmeidafeitosa9144 7 หลายเดือนก่อน

    Muito obrigado!

  • @jeffo.5753
    @jeffo.5753 7 หลายเดือนก่อน

    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);
    }
    }
    }

  • @sreenucnu4641
    @sreenucnu4641 7 หลายเดือนก่อน

    Good video bro

  • @manuelmq2043
    @manuelmq2043 7 หลายเดือนก่อน

    Tus videos y cursos estan chevres. El detalle es el idioma. Podrías traducirlo al español????

  • @abdokha6227
    @abdokha6227 7 หลายเดือนก่อน +1

    Why don't we use DBContext instead of Services ?

    • @martingrof1685
      @martingrof1685 7 หลายเดือนก่อน +1

      The databse might change in production, services allow decoupling.

    • @abdokha6227
      @abdokha6227 7 หลายเดือนก่อน

      @@martingrof1685
      Does using Dbcontext affect performance?

  • @bl7937
    @bl7937 5 หลายเดือนก่อน

    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?