views:

564

answers:

5

Title says it all, but 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?

+2  A: 

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

jons911
This is incorrect.
FlySwat
@Jonathan Holland is half right. The OP can install the extensions. @jons911 is correct in that AJAX is possible without AJAX extensions, you just have to roll your own.
Rob Allen
Actually, with WebForms, if you don't have the extensions, your pretty SOL, as the webforms model does not play nice with modifying pages on the fly.
FlySwat
+7  A: 

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.

FlySwat
MS also allows you to download the scripts without including the resource dll. All you need to do is include them in the project and set the ScriptPath on the Script Manager. This way you will get the option of using minified scripts and an easier time debugging.
StingyJack
Forgot the link http://www.asp.net/ajax/downloads/ 1st download button
StingyJack
+1  A: 

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.

James Curran
ASP.NET Webforms really does need the extensions, otherwise a lot of the state management gunk that Webforms does breaks when you try to just change content using native XMLHTTPRequests.
FlySwat
Um.... no it doesn't. If you are using the ASP.NET AJAX toolkit suite, then you need the System.Web.Extensions library in either DLL or code form. You can do Ajax to update all kinds of stuff on a webform without issue.
StingyJack
Until you do a regular postback and suddenly the Viewstate has changed and the webForms engine throws an exception. Anything beyond just copy changes (ie, if you need to add a new control) breaks it.
FlySwat
Duh, you cant add a control on the client side only and expect the server engine to know about it. If you are going to go to the trouble of drawing the controls on the client, then you should be handling their data persistence that way also.
StingyJack
Right, which is why MS introduced ASP.NET AJAX to workaround this difficulties with AJAX + ASP.NET. Its good to see that we've come full circle back to my original point.
FlySwat
... you can still create client only elements using asp.net ajax that will not be available to the server on postback. So; ASP.NET webforms do not NEED the extensions to do ajax calls, nor does having asp.net ajax negate the need for client side persistence for client created controls.
StingyJack
Ah... But the original message never mentioned anything about ASP.NET AJAX -- all it mentioned was generic AJAX. Maybe he meant that; maybe he didn't realize the difference.
James Curran
Voted up, because the question was misleading and i'm sick of people using AJAX when they mean the "ASP.NET AJAX" libraries. And FWIW, there's a lot of value in ASP.NET that has nothing to do with Web Forms and works perfectly well with whatever AJAX libraries you feel like using.
Shog9
+3  A: 

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.

StingyJack
jQuery was shipped for ASP.NET MVC. Webforms sucks at 3rd party handling of Ajax...End of Story.
FlySwat
"I'm excited today to announce that Microsoft will be shipping jQuery with Visual Studio going forward. " - from ScottGu's blog. Yes, this is the end of the story.
StingyJack
+1  A: 

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.

Adam N