How to Add Telerik Ajax to SharePoint

The steps below outline how to get started using Telerik Ajax within a SharePoint custom application page. If you’re developing a web part or even just a custom asp.net application, the concepts are still the same.

  1. Add the RadAjax.Net2.dll file into the GAC. If you need to find the RadAjax.Net2.dll file, if you’ve installed the Telerik web controls to your computer, they should be in the Telerik folder where you installed the Telerik suite.
  2. Insert the following register tag at the top of the aspx page:
    1
    
    <%@ Register Assembly="RadAjax.Net2, Version=1.8.1.0, Culture=neutral, PublicKeyToken=3f7b438d1c762d0b" Namespace="Telerik.WebControls" TagPrefix="radA" %>

    In order to determine what the version and publickeytoken should be, put the dll into the GAC (c:windowsassembly) and then right click the dll, click on Properties and you can copy and paste the version and publickeytoken.

  3. IISRESET
  4. Now that you have the control registered, it’s time to use it. Within the telerik ajax dll there’s two main controls to be aware of. The ajaxpanel and the ajaxmanager. The example I’ll show below is specific to the ajaxpanel. The following info is directly from the telerik ajax help:

    When to use RadAjaxPanel

    RadAjaxPanel is a lightweight control that lets you update a part of your web page with AJAX while keeping the rest of the page working with postbacks.

    AJAX Panel is more suitable for cases when you need to update a group of neighboring controls at once. You have to wrap the controls that should be ajaxified in the AJAX Panel. Only controls that are inside the Panel will be updated via AJAX. You cannot set the Panel to update external controls on the page.

    When a control (inside the Panel) tries to postback, it will make an AJAX request and all controls in the Panel will be updated.

    When to use RadAjaxManager

    AJAX Manager offers a complete solution for turning a postback-based application into an AJAX-driven one.

    RadAjaxManager control is mostly dedicated to complex scenarios. With AJAX Manager you have many AJAX initiator controls that update different non-adjacent controls. This is the major difference with AJAX Panel, which updates only itself (and controls that it holds).

So if you have a button, that does a lookup and populates some fields as an example, all you need to do is wrap that button and those fields inside a panel control. Note that if you just wrap the button within the panel, then the fields are not affected, and so clicking on the button will result in nothing.

Give that a shot, it’s pretty straight forward and easy to do and makes your custom web applications look a whole lot slicker!

, ,

No comments yet.

Leave a Reply