How to make DevExpress work on your Sharepoint 2010 Application Page

After reading many posts I can say it is very hard to find information on how to get Custom Controls created by third parties working properly in SharePoint 2010 Application Pages (I guess a lot of people are not doing them yet). The solution actually turned out to be a bit simpler than one would expect after hours of trying everything possible.

There are 3 things you can do to guarantee DevExpress’ controls work properly:

  1. Make sure the referenced libraries are available in the GAC
  2. Make sure you have added all the necessary entries in your web.config. This is the tricky part, SharePoint 2010 uses integrated authentication so you need to go to your “C:inetpubwwwrootwssVirtualDirectories80” folder and in that web.config find the modules section on the system.webserver (this is for integrated authentication, if you don’t have that you should use the system.web)
  3. Make sure you add the controls as safe controls in the web.config and ensure you have the required references in your aspx page.

How to add the Module to the web.config:

[xml]
<system.webServer>
<modules runAllManagedModulesForAllRequests=”true”>

DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a” name=”ASPxHttpHandlerModule”/>

</modules>
[/xml]

How to add the assemblies to the web.config:

[xml]
<compilation batch=”false” batchTimeout=”600″ maxBatchSize=”10000″ maxBatchGeneratedFileSize=”10000″>
<assemblies>
<add assembly=”DevExpress.Web.ASPxGridView.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A” />
<add assembly=”DevExpress.Web.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A” />
<add assembly=”DevExpress.Web.ASPxEditors.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A” />
<add assembly=”DevExpress.Data.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A” />
</assemblies>
</compilation>
[/xml]

System.WebServer settings on web.config:

[xml]
<system.webServer>
<modules runAllManagedModulesForAllRequests=”true”>
<add type=”DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a” name=”ASPxHttpHandlerModule” />
</modules>
<handlers>
<add type=”DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a”
name=”ASPxHttpHandlerModule” verb=”GET” path=”DX.ashx” preCondition=”integratedMode”/>
</handlers>
<validation validateIntegratedModeConfiguration=”false” />
</system.webServer>
[/xml]

DevExpress settings on web.config:

[xml]
<devExpress>
<compression enableHtmlCompression=”false” enableCallbackCompression=”true” enableResourceCompression=”true” enableResourceMerging=”false” />
<themes enableThemesAssembly=”true” />
callbackErrorRedirectUrl=”” />
</devExpress>
[/xml]

Config section on Web.Config

[xml]
<configSections>
<sectionGroup name=”devExpress”>
<section name=”compression” type=”DevExpress.Web.ASPxClasses.CompressionConfigurationSection, DevExpress.Web.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a” requirePermission=”false” />
<section name=”themes” type=”DevExpress.Web.ASPxClasses.ThemesConfigurationSection, DevExpress.Web.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a” requirePermission=”false” />
<section name=”errors” type=”DevExpress.Web.ASPxClasses.ErrorsConfigurationSection, DevExpress.Web.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a” requirePermission=”false” />
</sectionGroup>
</configSections>
[/xml]

Don’t forget your @Page directives:
[xml]
<div id=”_mcePaste”><%@ Register Assembly=”DevExpress.Web.ASPxGridView.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a”</div>
<div id=”_mcePaste”>Namespace=”DevExpress.Web.ASPxGridView” TagPrefix=”dx” %></div>
<div id=”_mcePaste”><%@ Register Assembly=”DevExpress.Web.ASPxEditors.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a”</div>
<div id=”_mcePaste”>Namespace=”DevExpress.Web.ASPxEditors” TagPrefix=”dx” %></div>
<div id=”_mcePaste”><%@ Import Namespace=”DevExpress.Web.ASPxEditors” %></div>
<div id=”_mcePaste”><%@ Import Namespace=”DevExpress.Web.ASPxGridView” %></div>

[/xml]

Don’t forget your @Page directives:[xml]<%@ Register Assembly=”DevExpress.Web.ASPxGridView.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a”    Namespace=”DevExpress.Web.ASPxGridView” TagPrefix=”dx” %><%@ Register Assembly=”DevExpress.Web.ASPxEditors.v10.1, Version=10.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a”    Namespace=”DevExpress.Web.ASPxEditors” TagPrefix=”dx” %><%@ Import Namespace=”DevExpress.Web.ASPxEditors” %><%@ Import Namespace=”DevExpress.Web.ASPxGridView” %>[/xml]

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.