Using jQuery in ASP.NET - asp.net

When using the AJAX functionality in jQuery, do I also have to have ASP.NET AJAX/.NET 3.5 installed also? or can I only use ASP.NET AJAX?
I'm unclear on whether or not I'm able to use AJAX in ASP.NET without ASP.NET AJAX or not.

No, you don't need ASP.NET AJAX installed to use the AJAX functionality of jQuery.
You can call PageMethods and Web Services without needing a ScriptManager control (which generates the JavaScript proxy objects that allow you to use familiar syntax to call web services and page methods).
Article on using jQuery to directly call ASP.NET AJAX page methods
Article on using jQuery to Consume ASP.NET JSON Web Services

Let me first clarify the use of jQuery. jQuery is simply a javascript library, and it has nothing to to with ASP.NET or any other server side platform such as PHP or JSP.
So you can simply use jQuery side by side with ASP.NET, or even combine jQuery with ASP.NET 3.5 that has AJAX built in.
You can also use jQuery's AJAX if you like, and it still can run in ASP.NET. If you want to combine both, please test your aspx page first if you also want to use ASP.NET's UpdatePanel with jQuery's AJAX, since it can bring incompatibilities between them.

No, if you're using jQuery you don't need ASP.NET AJAX installed.

ASP.NET Ajax is not needed in order to use jQuery, but the two work well together, hence the support from Microsoft.

Related

Alternative to Updatepanel in ASP.net

I want to know whether there is any better option to perform AJAX operations in my ASP.net webforms other than Updatepanel.
Because updatepanel sends lot of viewstate data in the request which in term affects the peroformace of the Application.
Thank You in Advance
You have a few options. You can disable ViewState, or you can use "plain AJAX".
If you choose to use "plain AJAX", you can write your low level JavaScript code or use libraries such as jQuery to make the AJAX calls easier.
On the server side, you'll need to expose some kind of endpoint for the AJAX calls to communicate to. Some people use WebMethod, but that has been deprecated and I would avoid this approach. You can use ASP.NET Web API in .NET 4.5, or in any version of .NET you can use handlers or generic handlers (.ashx) to expose endpoints.

Using AJAX in monodevelop

So I have been searching the web extensively for how to use the AJAX toolkit in mono ASP.
so far what I have gathered is that you need to add System.Web.Extensions
to your references. But for some odd reason I cannot use it in my WebForms site
<asp:ScriptManager> simply doesn't exists so can someone tell me what I have missed?
I'm using mono version 3.0.4.6
you need System.Web.Extensions if you like combine ajax calls and callbacks. But you don't need it if you use jQuery instead of ajax toolkit.
And monodevelop is only for edit the aspx or the js files and run xsp to do the test.
XSP will respond ok to the jquery calls

ASP.NET Ajax vs. JQuery for web service calls

I am dipping my feet into an app that uses both ASP.NET Ajax (ControlToolkit, etc.) as well as Jquery.
Are there any pros/cons to using the ASP.NET Ajax mechanics for calling JSON-serialized .NET web service methods ... vs. using JQuery .ajax()? (Or is it "6 and 1/2 dozen"?)
Thanks!
ASP.NET Ajax is deprecated and, I believe, no longer supported. It is pretty bulky too, as it tries to generate JavaScript objects instead of just using JSON. $.ajax is strongly recommended instead.
Here is a blog post that discusses the situation. It turns out ASP.NET Ajax is being moved into the Ajax Control Toolkit, which itself is shifting to a server-control focus. So if you're using ASP.NET WebForms and all the <asp:Whatever /> controls, Ajax Control Toolkit is OK... otherwise, e.g. if you're using ASP.NET MVC, definitely stick with jQuery.

Call a webservice in asp.net ajax

How can I calling a webservice not written by me from asp.net ajax. What's the latest and best way of doing it?
Call the Sys.Net.WebServiceProxy invoke Method
Details here
ASP.NET AJAX is not the preferred library any more. Use jQuery instead which also supports jsonp which is what you will need to call cross-domain web services from the client.

How would you go about using the ASP.NET AJAX Control Toolkit in a project that doesn't use ASP.NET on the back end

Your backend could be PHP or Python but you want to use the controls from the ASP.NET toolkit is there a successful way to do this?
I don't think that it is possible.
The ASP.NET AJAX Toolkit is based on ASP.NET technique (what a surprise) and needs ASP.NET.
It contains server-side controls, which are translated to HTML and Javascript by the ASP.NET engine. It is not working without the engine.
However you can check the code itself to see how it is working, what it generates on the browser side and get ideas and Javascript codes to build into your application or framework.
Edit: I've just found an interesting project, which is in alpha stage, check this out.
Why do you want to use the ASP.NET AJAX Toolkit with PHP / Python?
Have you considered other non ASP.NET specific AJAX libraries like jQuery, Dojo, MooTools, YUI?
ASP.NET AJAX and the ASP.NET AJAX Toolkit is ASP.NET centric, you'll gain more flexibility using other AJAX libraries with PHP / Python.
are you talking about the ASP.NET AJAX Control Toolkit?
Have a look at this blogpost on Stephen Walther's blog:
ASP.NET MVC Tip #36 – Create a Popup Calendar Helper
In this post he shows how to use the 'script only' version of the AJAX Control Toolkit. This version of the AJAX Control Toolkit does not contain server-side controls or control extenders. It contains only the client-side files – JavaScript, CSS, images – required to use the client-side AJAX behaviors.
Stephen Walther is a Senior Program Manager at Microsoft who is responsible for ASP.NET MVC content and community (his job title is ASP.NET MVC Ninja).
I have found that much of the functionality in AJAX Control Toolkit can be accomplished via the javascript frameworks such as jQuery.

Resources