Hello Friends, while we were working on Blazor projects. At that time when we tried to add jQuery components on the .CSHTML page, we learned that the integration of jQuery components is quite different than another .NET framework. A Blazor application can call JS functions from .NET methods.
Please don’t get confused with the term jQuery UI components. It is our source script for jQuery which we used in the <script> tag in razor pages.
To use jQuery UI components in a Blazor application please follow below steps:
To use jQuery UI components in a Blazor application we have to follow the above-mentioned steps. So, let’s check each step in detail.
Write the C# method to run the JS function under the @code section.
You can check the below image. We called the JS function using this InvokeVoidAsync method.
private async Task LoadDashboardData()
private async Task Logout()
In this article, we have learned how to use jQuery UI components in a Blazor application. I hope the steps and snippets in the blog, help you to integrate jQuery UI components in a Blazor application.
Thanks for reading