Click here to Skip to main content
15,905,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
This is amit kumar, I am working on MVC. My focus is to make software/web very friendly and very fast on busy counter where atlest 500+ more customers visits and i think only client side script may help for this and i uses Jquery for this. My question is as follows:
1. Calling Of All the methods/actions using jquery is good or not?
2. Even, I write code to call save/delete/modify action using jquery, Is it good practice or not?

Gentlemen, please reply.

Thanks and regards

What I have tried:

I have not tried any other technic to makes software fast.
Updated 14-Jan-21 4:50am

1 solution

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.
Share this answer
Amit Sharma (Patna) 18-Jan-21 2:43am    
Thanking you for your reply. But the project is in mvc it is not single page coding. it has controller, model and view but i m not using tag to posback. I have used Jquery call instead of .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900