As a long time .NET programmer (and previously VB / Classic ASP), I feel a huge callback in Blazor to Classic ASP, combining code into the page but with a seamless combination of server side and client side code without needing to implement heavy AJAX functions. At first glance, reading articles on Blazor how-to's I couldn't understand them that well. But your series has proven to be invaluable - I just started converting one of my current JS AJAX + Web API 2 projects into Blazor and with only a few hours of tutorials I'm almost up to speed with Blazor. Thank you! I can't wait to watch more of your videos.
Glad you figured it out! Yes, exactly! The @ref directive allows you to get a reference to the razor component in the code-behind, so you can interact with it programmatically.
Great question! Yes, it is possible to pass input arguments to the @onclick event handler method in Blazor. You can achieve this by using lambda expressions as below. Click me!
There are several options available that you can explore, including some licensed solutions. I recommend searching the Visual Studio Marketplace for extensions that fit your needs.
Thank you for your kind words and interest in my video tutorial. Unfortunately, I do not have the complete source code for download as this was just an explanation video.
With this component available as a reference why would anyone want to use [Parameter] attribute and pass values that way? Why can’t we simply reference all components and set the values like how you’re setting them using methods however pass the actual values in the method params
Without the [Parameter] attribute, those are just public properties. The values for properties with [Parameter] attribute can be assigned from the page design.
When I put the tag in ContactList.razor component I have an error "RZ10012: Found markup element with unexpected name 'DeleteConfirmation'. If this is intended to be a component, add @using directive for its namespace". The DeleteConfirmation componend is in the Shared folder and my _imports.razor has the @using directive for the Shared directory... I don't understand what is wrong. thank ypu
Solved: I created a new DeleteConfirmation2.razor component and copied into it the code of the "old" component. Then I have changed the tag in ContactList.razor to refer to the "new" component and deleted the "old" DeleteConfirmation.razor component and the compiled the project with no errors. Finally I renamed the "new" component back to the "old" DeleteConfirmation.razor and changed back also the reference in ContactList.razor component. It clearly wasn't an error in the code but a VS2022 bug....
Thanks for the clear and concise explanation.
You are welcome!
As a long time .NET programmer (and previously VB / Classic ASP), I feel a huge callback in Blazor to Classic ASP, combining code into the page but with a seamless combination of server side and client side code without needing to implement heavy AJAX functions. At first glance, reading articles on Blazor how-to's I couldn't understand them that well. But your series has proven to be invaluable - I just started converting one of my current JS AJAX + Web API 2 projects into Blazor and with only a few hours of tutorials I'm almost up to speed with Blazor. Thank you! I can't wait to watch more of your videos.
Thank You so much! Glad to hear that. Your words mean a lot to me.
It's somehow not quite clear to me why exactly we needed this @ref now.
Ok. I have just understood it. This is the reference to this ContactList object, which we have added to Index.razor.
Glad you figured it out! Yes, exactly! The @ref directive allows you to get a reference to the razor component in the code-behind, so you can interact with it programmatically.
How do you pass input arguments to the @onclick event handler method? Is it possible? Please share an example
Great question! Yes, it is possible to pass input arguments to the @onclick event handler method in Blazor. You can achieve this by using lambda expressions as below.
Click me!
Somehow the upper close button of the popup isn't working for me. Instead of a cross it's a weird rectangle...
@HeadingContent
@BodyContent
Close
Confirm
Please confirm you are including bootstrap CSS file (css/bootstrap/bootstrap.min.css) in the _Layout.cshtml file.
@@CodingDroplets I changed the line to × and now it works. :)
Great! ...
Can anyone please recommend a bootstrap 5 snippet extension for Visual Studio 2022. It would be helpful.
There are several options available that you can explore, including some licensed solutions. I recommend searching the Visual Studio Marketplace for extensions that fit your needs.
Hi, it is one of the good online tutorials. Do you have the complete source code to download? or which project in your gitgub?
Thank you for your kind words and interest in my video tutorial. Unfortunately, I do not have the complete source code for download as this was just an explanation video.
Is there a github link that we can use to download this codebase?
No .. Atleast you've to understand few concepts by watching the video
With this component available as a reference why would anyone want to use [Parameter] attribute and pass values that way? Why can’t we simply reference all components and set the values like how you’re setting them using methods however pass the actual values in the method params
Without the [Parameter] attribute, those are just public properties. The values for properties with [Parameter] attribute can be assigned from the page design.
When I put the tag in ContactList.razor component I have an error "RZ10012: Found markup element with unexpected name 'DeleteConfirmation'. If this is intended to be a component, add @using directive for its namespace". The DeleteConfirmation componend is in the Shared folder and my _imports.razor has the @using directive for the Shared directory... I don't understand what is wrong. thank ypu
Solved: I created a new DeleteConfirmation2.razor component and copied into it the code of the "old" component. Then I have changed the tag in ContactList.razor to refer to the "new" component and deleted the "old" DeleteConfirmation.razor component and the compiled the project with no errors. Finally I renamed the "new" component back to the "old" DeleteConfirmation.razor and changed back also the reference in ContactList.razor component. It clearly wasn't an error in the code but a VS2022 bug....
Glad to know the issue is fixed.