views:

34

answers:

2

Hi,

I am completely new to AJAX for ASP.NET. How do I check if AJAX client side framework is installed on my server? I am using Visual Studio 2010 and ASP.NET target framework is 3.5. If it is not installed then is it free to download and install for ASP.NET 2.0? Detailed help would be much appreciated.

I am facing the following problem: Please have a look at the code below:

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>

</title><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="../Files/scriptname.js" language="javascript" type="text/javascript"></script>
<body> <script src="/PSTest1/WebResource.axd?d=Gv665v31f2LmvKc6l5ZtYg2&amp;t=633739595980000000" type="text/javascript"></script> <script src="/PSTest1/ScriptResource.axd?d=DvXzLAuBdskYlxKlDkfcX8lFN-isZoYYhwzWQ30kz1wvf3Dj_xhMp8sWyiNF4I0Wwd7ZFgznqsOqVBwLjV_e-OD3WoTK41QMAxZe28c_Fjw1&amp;t=fffffffff948d308" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.'); //]]> </script>

<script src="/PSTest1/ScriptResource.axd?d=DvXzLAuBdskYlxKlDkfcX8lFN-isZoYYhwzWQ30kz1wvf3Dj_xhMp8sWyiNF4I0Wa-X8RUnO7myv4R_LVgNXGlN0jNB4gWBd9KVIV5JCR7EPe-ny78LJC5r8gRrhPIGv0&amp;t=fffffffff948d308" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager1', document.getElementById('aspnetForm')); Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90); //]]> </script>

What exactly seems to be the problem as the same js file produces a desired effect on some other platform and not mine. I am working on .NET 3.5 , ASP.NET 2.0, Visual Studio 2010

A: 

It should be installed if you are using 3.5. I believe that it is in the System.Web.Extensions dll.

bechbd
He's talking about the client side framework, i.e. the XmlHttpRequest object.
Keith
is there a way to check it?
VP
A: 

I think you're talking about 2 different things.

The .NET framework version 3.5 and above include the .NET AJAX libraries. Also, if you are limited to using 2.0, you can download the AJAX Extensions from Microsoft: AJAX Extensions 1.0

If you're talking specifically about whether or not a client/browser supports AJAX (a la the XMLHttpRequest object), there are many resources that will help, but the basic (js) syntax for retrieving the correct object is:

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }

When you use the .NET AJAX libraries, this (or similar) code will be generated for you.

Keith