Integrating jQuery with ASP.NET(ferry.ferryandtheria.com)

submitted by ferrymulyonoferrymulyono(395) 4 years, 4 months ago

An altenative AJAX solution to use jQuery instead of ASP.NET AJAX.

5 comments |category: |Views: 120

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by duckieduckie(150) 4 years, 4 months ago 0

I would not call that a nice solution. Having to handle querystrings is imho bad.

Throw out asp.net ajax, and use Ajax.NET Professional instead (http://www.ajaxpro.info/).

I added this line to my masterpage in codebehind(as written from memory):
AjaxPro.Utility.RegisterTypeForAjax(typeof(SomeNamespace.BasketAjax));

Then i can just call this in javascript
SomeNamespace.BasketAjax.AddBasket(item,amount,AddBasket_Callback);

Clean code, no messing with querystrings

Reply

posted by duckieduckie(150) 4 years, 4 months ago 0

Furthermore, the article is incorrect on several points, it just doesnt really make any sense / good points

"you couldn’t control the data format exchanged between the server and the client" & "Compare it to jQuery, that enables developer to specify what data gets exchanged"
jQuery cannot specify what data is exchanged. It can specify what is requested from the server. The server returns whatever it wants.

"what would I want to use jQuery instead of ASP.NET AJAX ... the answer would be “bandwidth” a.k.a performance. "
jQuery is not a answer to eliminating bandwith. The solution is to only request/return what is needed. Jquery is only a tool to fetch those data.

What this article really is doing, is just reinventing asp.net ajax' webmethods!

Correct me if i am wrong =)

Reply

posted by gavinjoycegavinjoyce(25.7k) 4 years, 4 months ago 0

I interpreted the 'control the data format exchanged' as you can work at a lower level exchanging data as apposed to working with the UpdatePanel (when in control of both sides). I'm sure ASP.NET AJAX has support for low level too, but I haven't used it much.

I kicked this story as it shows at a low level how to use jQuery and ASP.NET. Of course you shouldn't use this for production, but the example highlights the workings of jQuery which is worth a kick from me.

Reply

posted by duckieduckie(150) 4 years, 4 months ago 0

Not bashing the article, but i surely hope my comments results in a update (regarding asp.net ajax not beeing able to do low-level ajax-requests).

Reply

posted by simonebsimoneb(5450) 4 years, 4 months ago 0

I'm with duckie on this, he article doesn't say anything useful and the solution is nothing more than a newbie could do.

Reply

information Login or create an account to comment on this story