On the one hand,
You Might Not Need jQuery[
^]. A lot of what jQuery does for you is fairly simple to do in plain Javascript. For example, if you're only supporting modern browsers, you can replace jQuery's AJAX methods with
the Fetch API[
^] *.
On the other hand, some of the Javascript libraries you're using probably rely on jQuery. For example, the default validation uses
jQuery Validation[
^] and
jQuery Validation Unobtrusive[
^] . Bootstrap
(prior to v5) uses jQuery.
The latest version of jQuery is 30Kb
(minified and gzipped), so it doesn't add a huge overhead to your page. And you can load it from a CDN, which means most users will probably already have it cached.
Since you mention calling the server-side actions via AJAX requests, it sounds like you're writing a Single Page Application. You might want to consider using Blazor for that:
Blazor | Build client web apps with C# | .NET[
^]
* NB: If your server-side code uses the Request.IsAjaxRequest()
method, you'll need to explicitly add the X-Requested-With: XMLHttpRequest
header if you use the Fetch API.
Depending on your requirements, you may also need to specify the credentials
option for the fetch requests, since the authentication cookie won't be sent by default.