AjaxDataControls (ADC) FAQ - How to get started with the AjaxDataControls and Visual Studio 2008?

This is a followup small how-to on my previous post:

AjaxDataControls (ADC) FAQ - How to get started with the AjaxDataControls with Visual Studio 2005? 

The basic idea is the same, however to make it easy to get started with VS2008 and ADC, I will repeat some steps that were used in my previous post.

Fireup up Visual Studio 2008 and select File->New Website. The first thing you will notice is that there is no "Ajax Enabled Website" template anymore. The reason is simple: ASP.NET Ajax is already built into .NET 3.5. Therefore we will go ahead and select "ASP.NET Web Site". I will call my project simply ADCSampleWebsiteVS2008 - feel free to change this to whatever you like.

Once you have created the empty project, you need to make sure that you add the necessary AjaxDataControls.dll, which you can get from:


However make sure that you get the binaries that were compiled for .net 3.5.

Once you have added the dll, we need to make some small changes to the web.config and add the following line between the <controls> section:

<add tagPrefix="AjaxData" namespace="AjaxDataControls" assembly="AjaxDataControls"/>

Your section should look like this now:

    <add tagPrefix="AjaxData" namespace="AjaxDataControls" assembly="AjaxDataControls"/>

If you want to return DataTables from your webservice or pageMethods you will also need to declare the following converters:

<jsonSerialization maxJsonLength="4194304">
    <add name="DataSetConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataSetConverter, Microsoft.Web.Preview"/>
    <add name="DataRowConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataRowConverter, Microsoft.Web.Preview"/>
    <add name="DataTableConverter" type="Microsoft.Web.Preview.Script.Serialization.Converters.DataTableConverter, Microsoft.Web.Preview"/>

Besides that you will need to download the ASP.NET Futures and add the binaries Microsoft.Web.Preview.dll to your website project - make sure that you use the .net 3.5 binaries here as well.

This should go in between the <scripting>/<webServices> section.

You are now done with the web.config.

The rest is basically the same as described here. You need to add the webservice - a test function and the script code. Follow the steps in the mentioned post and you should be ready to go.

You can download the ADCSample VS2008 Website from here.

Published Tuesday, June 24, 2008 2:04 AM by sonu


# AjaxDataControls (ADC) FAQ - INDEX

Tuesday, June 24, 2008 12:24 AM by Sonu on .NET

Welcome to the AjaxDataControls FAQ. How to get started with the AjaxDataControls with Visual Studio