ASP.NET - Introducing Blazor: Interactivity [12 of 13]

Play ASP.NET - Introducing Blazor: Interactivity [12 of 13]

The Discussion

  • User profile image
    Heretic

    Razor pages are interesting, Blazor components likewise. Almost Silverlight in its obscurity. (Sorry that slipped out).
    Having spent the last 15 odd years working on WebForms (aspx), I keep looking for "how do I?" examples. Like what's the equivalent of meta:resourceKey, where are the common controls like GridView, FormView etc. Even something as basic as <asp:label associatedControlID etc.

  • User profile image
    seahunt
    Leslie and Scott, I want to thank you both for this excellent and educational series. You make a great team presenting very valuable information.
    A couple of points though. I wish you had demonstrated the Logger once.
    Also, I had a problem in this video. I couldn't find blazor.server.js so I thought I would post the solution that in Layout.schtml it needed the line: [base href="~/" /] (replace the braces with angle brackets).
    Also, sadly I have to say I couldn't get the popup to work which confused me as the debugger showed the code being there. I'm not as concerned though as that wasn't the most important part to me. Maybe I'll play with it more...
    Thank you again, M
  • User profile image
    Kev

    @seahunt,
    Just in case you haven't gotten your modal popup to work yet ( or for someone else with the same problem ), try the following:
    1. Move the script tag line
    <script src="_framework/blazor.server.js"></script>
    from the index.cshtml file to the bottom of the _Layout.cshtml file ( as suggested by others on the previous video ), just before the </body> tag.
    2. Make sure your button syntax is exactly as given in the snippet.
    3. Change the declaration of the selectedProduct field to
    Product selectedProduct = new Product(); This will make the logic work for the DIV, otherwise what happens is that the first time the page loads the selectedProduct is still null when you click the button and the event fires for the diff but nothing happens because the selectedProduct is still null. Only after the code has executed does that condition become valid and so only on the NEXT button click does the DIV popup.
    I hope this helps someone.

  • User profile image
    Kev

    I don't get the stars to appear. This is the problem with "Magic" happening in the background, namely that you have no control over or an idea as to how it's supposed to work.
    So if anyone has any solution, please let the followers know. Thanks.

  • User profile image
    Kev

    Update: Missing Stars - put something in the span otherwise it just gets skipped.

Add Your 2 Cents