ADO.NET Data Services AJAX Client Library in VS2008 SP1 Release

October 25, 2008

ADO.NET Data Services AJAX Client Library in VS2008 SP1 Release

In a previous post ADO.NET Data Services AJAX Client Library in VS2008 SP1 Release
I showed how to
build an Ajax client
for a data service.
In that post I added to
the solution a new
ASP.NET 3.5 Extensions Web Application project which came with the the
ASP.NET 3.5 Extensions preview. In that preview the ADO.NET data
services Ajax client library
was embedded in the System.Web.Extensions
assembly. In the release of VS2008 SP1 the ADO.NET data services Ajax client
library
is no longer a part of the System.Web.Extensions assembly.

The First Solution – ADO.NET Data Services AJAX Client Library

If you want to use the Ajax functionality without the need to use the
ASP.NET 3.5 Extensions Web Application template you can download the
library from here. The download contains two js files – DataService.js and
DataService.debug.js. After you downloaded and extracted the files you
can include them in every web application that you build.
Put the files in Scripts directory (or where ever you prefer to put it)
in your project and then register the script reference in the ScriptManager
like this:

    <asp:ScriptManager ID="ScriptManager1" runat="server">

      <Scripts>

        <asp:ScriptReference Path="~/Scripts/DataService.js" />

      </Scripts>

    </asp:ScriptManager>

After you registered the js file script reference you’ll be able to use it in
your client scripts.

Another Solution to the Problem

Another way to solve the problem is to use the System.Web.Extensions
assembly that came with the ASP.NET 3.5 Extensions preview. First you’ll
need to replace the System.Web.Extensions (version 3.5) that your project
reference with the System.Web.Extensions (version 3.6) that is located in
the following path:
C:\Program Files\Reference Assemblies\Microsoft\Framework\ASP.NET 3.5 Extensions.
After the replacement, you should go to the web.config file and replace the version
of System.Web.Extensions to 3.6.0.0 instead of 3.5.0.0. Doing so will enable every
web application to use the ADO.NET data services Ajax client library as I wrote in
the previous post.

Summary

I gave two ways to solve the problem of adding
ADO.NET data services Ajax client library to your project.
I tested the ways that I suggested and both of them are working well. If you ask me,
I recommend the first solution but you can choose from both of them.
You can use the first and then you’ll have to update the js files every time a new
version will appear in codeplex. You can use the second and you will be bound to the
System.Web.Extensions (version 3.6) assembly that is currently a part of the
ASP.NET 3.5 Extensions preview and not a part of the new SP1 release. The choice
is yours. 

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

2 comments

  1. Rotem BloomNovember 2, 2008 ב 2:31

    Gil other good solution is to use the (Defines a collection of tag types that are remapped to other tag types at compile time) on the web.config.


    Reply
  2. Gil FinkNovember 2, 2008 ב 5:01

    Thanks Rotem.
    I Will try this also.

    Reply