Wednesday, June 18, 2008

Brief overview of requirements for using Ajax with Sharepoint 2007 web parts

If you want to use the AjaxControlToolkit controls with Sharepoint 2007,


  • Installed the Ajax Server Extensions
  • Installed the AjaxControlToolkit
  • Upgraded Sharepoint to Service Pack 1 or later
  • Upgraded WSS 3.0 to Service Pack 1 or later
  • Copied the AjaxControlToolkit.dll file to the bin folder of your portal under C:\Inetpub\wwwroot\wss\VirtualDirectories\yoursite\bin
  • Updated the Web.config by adding relevant entries to support Ajax -> C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config (copy entries from web.config in a website you created by using the Ajax Enabled website starter kit in Visual Studio)
  • FORGET ABOUT SMARTPART or any other 3rd party web parts that convert user controls into web parts. That was a crude workaround for versions of sharepoint before service pack 1.
  • Use the web part development add-in for visual studio (use it to develop, deploy and debug)
  • Add Scriptmanager control to your masterpage

    <WebPartPages:SPWebPartManager runat="server"/>

    <asp:ScriptManager ID="ScriptManager1" runat="server"/>
    <-- that is exactly where you must insert it
  • Remember to publish your masterpage after adding the scriptmanager
  • Toolkit controls have to be dynamically constructed in web part codebehind
  • If your webparts are iterating through sub-sites remember to use the SpSecurity.Delegate functionality as described in an earlier post in this blog.
If you're reading this and you see that i've missed something, please let me know.

No comments: