ASP.NET AJAX vs jQuery in ASP.NET MVC

后端 未结 10 1001
日久生厌
日久生厌 2020-12-07 19:08

Which one is better to use in ASP.NET MVC?

相关标签:
10条回答
  • 2020-12-07 19:46

    Instead of making a recommendation I suggest you read Dave Ward's blog Encosia that has a series of posts on MS Ajax/ Update Panel vs. jQuery post mechanism. Dave maintains that the performance of jQuery is vastly superior as it cuts out approximately 100K from the transmission to and from the server.

    0 讨论(0)
  • 2020-12-07 19:46

    First of all, it could be useful to take in mind that ASP.NET MVC doesn't support, or better, doesn't has the postback concept..

    1. asp.net ajax it's based on the post-back, server-side mechanism, it's mission it's to make more easy to integrate ajax features in a server-side mode
    2. jQuery, as other frameworks (eg Extjs) implements a pure client-side ajax

    It's still possible to use asp.net server controls in asp.net mvc, asp.net ajax it's one of them, but asp.net mvc it's made, it was thought, to separate concerns (views) and to be REST styled as close as possible, so taking this in mind the final thought would be:

    1. Using ASP.NET Web Forms ASP.NET AJAX it's the right choiche
    2. Using ASP.NET MVC it's better to try to go client, so jQuery (or others) is the better

    Sorry for my english

    0 讨论(0)
  • 2020-12-07 19:49

    JQuery is purely client side library. Asp.Net Ajax includes both client side and server side functionalities. IMHO, comparison ain't really fair. They might complement each other going by Microsoft's plans.

    0 讨论(0)
  • 2020-12-07 19:54

    Personally I prefer jQuery for the following reasons:-

    1. The plug-in community is far more varied and attracts developers from a broad range of backgrounds (not just the MS stack). For MS-AJAX you're pretty much constrained to the clientside AJAX control toolkit for your UI widgets at the moment.
    2. I find the jQuery API far more applicable common clientside tasks than that offered by MS AJAX
    3. Given the lack of WebForms smoke and mirrors going on in MVC you sometimes need a firm control over the DOM to do certain things, the CSS selector engine offered by jQuery really helps you do this.

    In terms of what MS AJAX offers you in MVC, it can do a lot for you in terms of giving you a quick way to "AJAXify" forms and links, but as far as I'm concerned adding 90kb worth of javascript to do that isn't really worth it when the equivalent calls in jQuery (e.g $.get, $.post, $(element).load) are relatively easy to use.

    0 讨论(0)
提交回复
热议问题