XMLHTTPREQUEST or AJAX Update panel? - asp.net

whenever I've used Ajax, I've used asp.net Ajax update panel and script manager provided in visual studio (and Ajax extensions if I needed them), but just recently I bought this (Pro Ajax and .Net 2.0 Platform and in this book the whole focus of Ajax has been XMLHTTPREQUEST, and there is no discussion of script manager, update panel or what so ever.
So, I wanted to know, is there any difference between these two or is this visual studio's update manager is just a wrapper around XMLHTTPREQUEST? Also, which one is better performance wise, or are they just the same? And finally, which one should I use?

Script Manager, Update Panel are Microsoft implementation of the AJAX framework. Internally it use XmlHttpRequest to make out-of-bound request.
Check out the below list of AJAX framework from wiki.
http://en.wikipedia.org/wiki/List_of_Ajax_frameworks
Microsoft AJAX implementation is type of full framework which provide rich programming model including server side controls, services and client side scripts. Eg. Update Panel server control lets you execute server-side code and return updated markup to the client browser with out-of-bound request.
But as for performance wise, it would be slower than service base/ajax because although out-of-bound request, UpdatePanel is really a post back to the server which will go through the full page life cycle.

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.

ASP.Net Controls in Delphi

I'm sure this question has been asked already but I couldn't find any posts.
Is it possible to use an ASP.net control in Delphi 2006 for Win32? We have some Dev Express ASP.Net visual controls (Chart controls to be exact) that we would like to use in our Delphi application.
Is this possible and how could it be done, preferably without the need to purchase more third party components.
Thank you.
you cannot use this kind of controls directly in a Delphi Win32 Application, because this components are designed to run in a web server with ASP and expose the results to a browser client, i think which your best option is use a local (or remote) web server and make a web page which accepts HTTP requests, and then in TWebBrowser in your Delphi Win32 app load the page to get results.
That is not going to be possible as the DevExpress ASP.NET controls are wired up via handlers in the web.config and not something that can be forced into Delphi. I assume you have looked at DevExpress's VCL controls for (Delphi and C++ Builder Controls) on it's website? If the VCL product suite does not have what you need then you will need to look elsewhere.

Is the ASP.NET Ajax Library dead?

I've recently stumbled across a few blogs that say the ASP.NET Ajax Library is dead, in particular:
http://encosia.com/2010/10/04/understanding-jquerys-impact-on-microsoft-and-asp-net/
http://weblogs.asp.net/toddanglin/archive/2010/04/19/microsoft-ajax-client-library-is-dead-long-live-jquery.aspx
Is this generally true, technically and practically?
I've been to Microsoft talks on jQuery, and basically it sounded to me like they expected everyone to use jQuery for client-side-only DOM manipulation and ASP.NET Ajax was still used for it's Ajax components (like UpdatePanel) and as a basis for AJAX into .NET services made with WCF or just back to ASHX or other server code.
From being a component developer that targets ASP.NET, I can tell you that it's very much used by our customers, and we need to support it.
Yes, it is. Even for SharePoint developers (which uses ASP.net AJAX heavily) it's out of favor.
However, the SERVER SIDE ASP.net AJAX (UpdatePanel etc.) are alive and kicking. They have some shortcomings (UpdatePanel can send tons of viewstate back and forth).
But the Client Side Framework and ASP.net AJAX Library is dead.
Scalable comet ajax is more popular now. Try the samples of PokeIn library.
A technology can't die if it's customer base is so big!

ASP.NET AJAX - AJAX Control Toolkit - jQuery - Oh My?

Take a trip with me back in time about three years ago. I remember building web controls that were dynamically inserted into the HTML of a page via AJAX and then rendered in place. We used the Prototype JavaScript library and the XMLHTTP Request object. Microsoft ATLAS has just been released.
After about three years of non web development work in Java, Compact Framework, some iOS etc ... and I find myself in a whole new world. Microsoft AJAX, the AJAX Control Toolkit, and jQuery. I find myself with a new project that has utilized some aspects of ASP.NET AJAX but mostly just the update panel and some client-side UI updates that jQuery now seems to make trivial.
So here is the question .. Is there still value in studying and becoming familiar with ASP.NET AJAX? Is it still used going forward? What about the AJAX Control Toolkit? Has this been abandoned my Microsoft in favor of a jQuery based infrastructure? Is jQuery coupled with JSON and web services the way to retrieve data?
It's still used in the WebForms world, however Microsoft has abandoned it in the MVC framework. So unless you're a diehard WebForms guy it doesn't make much sense. Especially considering you can use jQuery in WebForms projects as well.
This article gives a pretty good summary of the jQuery/Microsoft AJAX situation. Basically, jQuery is the way forward!
I think, from a career perspective, you'd be better off becoming familiar with jQuery (or a similar client-side JavaScript framework) and having that code interact with web services, WCF services (preferred, IMHO) or, if you're using ASP.NET MVC, JsonResults.
If you go to the Microsoft AJAX site (http://asp.net/ajax), they really don't mention their AJAX framework anymore, and the AJAX Control Toolkit is really there for people who don't want to work with JavaScript.
I started off, like you, using the AJAX Framework and the AJAX Control Toolkit and have made the transition to jQuery, JSON and other, more streamlined, ways of creating web applications. I'd recommend you'd follow the jQuery/JSON/services path instead of Microsoft AJAX.
Just my 2 cents.

Any way to use ASP.NET AJAX when my server does not and can not have the ASP.NET AJAX extensions Installed?

I have a server with .Net 2.0 sp1 installed and have no ability to install the AJAX extensions on the server.
Is there anyway I could work around this to incorporate ASP.NET AJAX functionality?
You don't need to install the AJAX extensions into the server's GAC.
You can locally reference System.Web.Extensions.dll from your applications BIN folder....I've done it half a dozen times.
Copy that DLL to your projects local bin. Reference it from your project. Remember to deploy the DLL when you deploy, and you are set.
Theres always prototype and jQuery for AJAX calls.
Both of which are perfectly valid for making Ajax calls to the server, despite Jonathan Hollands persistence (and his down-voting of everyone else's response) to the contrary.
MS now packages jQuery with Visual Studio, so there is no interoperability problem.
Please remember that the server has no knowledge of controls created on the client side, and you will have to take the extra steps to persist any data (via ajax calls) to the server.
If you can't install AJAX extensions, you will have to manage the AJAX calls yourself. It's absolutely possible, since AJAX Extensions just wrap the meat of AJAX. Read up on XMLHttpRequest and you'll find many examples.
Here's a good site with examples.
http://www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples
Note that most of AJAX is done on the client side (in the browser) in Javascript.
While there are some server-side libraries to make responding to a AJAX query easier, for the most part they are unnecessary. Any server technology that can server a web page to a browser can handle an AJAX request just as well.
Microsoft ASP.NET AJAX is not the only way to implement AJAX Functionality. jQuery and Prototype are two popular javascript libraries for working with AJAX, regardless of server platform.
If you're tied 100% to Microsoft ASP.NET AJAX, then you may need to download it and install the DLL manually to your local project.

Resources