Microsoft Office Project Server 2007 and AJAX.NET

Thanks to Boris Scholl :)

Microsoft Office Project Server 2007 is built on top of Windows Sharepoint Services, so you might think you can develop AJAX Web Parts as you do in Windows Sharepoint Services, right?

Unfortunately it’s not that easy. Actually the Web Part development process is the same, but you need to configure Project Server 2007 for AJAX support.

Here’s what you need to do:

You must configure the Project Web application and the Shared Services Provider Web Application to support calling Web services from script. In the Web.config file for the application, you must register the ScriptHandlerFactory HTTP handler, which processes calls made from script to .asmx Web services. For Web service calls that are not issued from ASP.NET AJAX script, the handler delegates the call to the default handler.

You need to add the following lines to the web.config located in:

C:\Program Files]\Microsoft Office Servers\12.0\WebServices\root

    1: <httpHandlers>
    2:   <remove verb="*" path="*.asmx" />
    3:   <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,    System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>
    4: </httpHandlers>

You also need to add the following line to the web.config of your project server installation which can be found here:

C:\Inetpub\wwwroot\wss\VirtualDirectories\[PSweb app directory]

    1: <httpHandlers>
    2:   <remove verb="*" path="*.asmx" />
    3:   <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,    System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>
    4: </httpHandlers>

After making those changes to the config files the client runtime is now enabled for AJAX and you can start building AJAX Web Parts.

Have fun!

A related article : Optimizing custom Web parts for the WAN