Tuesday, September 18, 2012

Using DevExpress Web Controls in SharePoint 2010

I use DevExpress controls in my SharePoint projects, as most developer knows there is a manually process of adding dlls to Gac then safe control entries and then web.config related changes.

To make this process a bit simpler i came up with the following steps (for SharePoint 2010)

1- Stop "SharePoint 2010 Administration" Services from windows services ,

2- Install Deveexpess setup or access system on which its installed and then open below mentioned path.
 C:\Program Files (x86)\DevExpress 2011.2\Components\Tools\SharePoint (w.r.t installed devexpress version)  Run ASPxSharePointRegisterer.exe file.
Note: this will register dlls in GAC and add some web.config safe-control entries for SharePoint Dexpress controls.

3- Start Sharepoint 2010 administration services again.

4- For using devexpress asp.net web form controls open your Web-application web.config and make following changes


  •  Add any missing safe-control entry e.g. I wanted to use ASPxTreeList

<SafeControl Assembly="DevExpress.Web.ASPxTreeList.v11.2, Version=11.2.11.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxTreeList" TypeName="*" Safe="True" />


  •  In <system.web> <httpHandlers> add

      <add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v11.2, Version=11.2.11.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET"
      path="DX.ashx" validate="false" />
   

  • In <system.web>  <httpModules> add

      <add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v11.2, Version=11.2.11.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule"/>
 

  • In <system.webServer> <handlers> Add

     <add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v11.2, Version=11.2.11.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET" name="ASPxHttpHandlerModule"
      path="DX.ashx" preCondition="integratedMode" />
 

  • In <system.webServer>  <modules> Add

     <add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v11.2, Version=11.2.11.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule"/>
 
5- In your visual studio solution make sure added assemblies properties Copy Local = true
DevExpress.Data.v11.2
DevExpress.Web.ASPxEditors.v11.2
DevExpress.Web.ASPxGridView.v11.2
DevExpress.Web.ASPxTreeList.v11.2
DevExpress.Web.v11.2 

Please share your steps or if you have developed program through SPWebConfigModification.

No comments:

Post a Comment