Alec Tang

Professional Web Developer/ Web Designer

I build websites based on the latest web standards providing the best possible solution to your company

  • Home
  • About
  • Portfolio
  • Contact
  • Blog
Subscribe Feed

Integrate Ajax Control Toolkit into Sharepoint

Posted by Alec on Fri, 12 Feb 2010, in ASP.NET C#   Sharepoint   

I wanted to use Ajax control toolkit in Sharepoint, and had not had any luck until I spent the whole day debugging and getting it to work. I already had Ajax integrated in Sharepoint, so it should be fairly easy to just add in AjaxControlToolkit, but the problem is the latest version of it actually requires you to use ToolkitScriptManager instead of ScriptManager, otherwise your control will not work and you will see a Javascript error of "Please wait while scripts are loaded".

So, to change the ScriptManager to ToolkitScriptManager in the master page, it ain't easy as Sharepoint will throw the error of unknown server tag: ToolkitScriptManager. To workaround that, we need to add some references in web.config of Sharepoint:

In my Controls tag in web.config, I added an addition mapping for asp tag prefix controls:

<add tagPrefix="asp" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, 
Version=3.0.31106.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />

What that does is it will add all ajax controls into standard asp tagged controls. For example, we can start using <asp:ToolkitScriptManager in Sharepoint designer, without actually adding any reference on top of the master page. There are more settings you need to add in web.config, refer to Jan Tielen's blog post. Beware of his version numbers as the new version should be 3.0.++.

After solving that, I tried refreshing Sharepoint, then it gave me another error! This time, a never seen before:

could not load type 'system.web.ui.scriptreferencebase' from assembly 'system.web.extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35'.

After a bit of googling, it seems like this was because .NET 3.5 framework SP 1 had not been installed on my machine. After installing it, the error was gone.

Then, to use Ajax Controls, I just drag and drop the control onto my page (web part), and Visual Studio will add the reference on top of the page for me:

<%@ Register Assembly="AjaxControlToolkit, Version=3.0.31106.0, Culture=neutral, 
PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit.HTMLEditor" 
TagPrefix="asp" %>

 

Comments Be the first to write a comment. Comment gets approved before publishing.

Post Your Comment

 
 
   

Search

 

Latest Posts

  • Sys.WebForms.PageRequestManagerParserErrorException
  • How Google treats Content Duplication
  • How to create HTML column in Sharepoint List View
  • How Sharepoint stores User Data
  • How to send email via Sharepoint
  • Malaysia Airlines launched iPhone Application: MHMobile
  • Intranet, the next big market
  • How to retrieve and update from a multi choice Checkboxlist ...
  • Auto Complete returns giant list of undefined
  • Integrate Ajax Control Toolkit into Sharepoint

Categories

  • Browsers (1)
  • Projects (1)
  • Web Design (6)
  • Sharepoint (20)
  • Telerik (5)
  • Wordpress (1)
  • Internet (1)
  • SQL (5)
  • LINQ (3)
  • ASP.NET C# (33)
  • JavaScripts (3)
  • IIS (0)
  • Industry (1)
  • Tools (8)
  • SEO (4)

Archives

  • May 2010 (1)
  • April 2010 (3)
  • March 2010 (5)
  • February 2010 (4)
  • January 2010 (11)
  • November 2009 (3)
  • October 2009 (1)
  • September 2009 (9)
  • August 2009 (3)
  • July 2009 (4)
  • June 2009 (1)
  • May 2009 (2)
  • April 2009 (8)
  • March 2009 (6)
  • February 2009 (2)
© Copyright 2009 Alec Tang. All Rights Reserved.
This site is conform to W3C Standard XHTML & CSS