Portal Engine
Version 3.x > Portal Engine > ASP.net AJAX in Portal View modes: 
User avatar
Member
Member
chris-ricochetpartners - 9/18/2008 12:40:16 PM
   
ASP.net AJAX in Portal
I am new to developing with Kentico and trying to understand how to use ASP.net AJAX and the AJAX Control Toolkit (if possible) within the Portal. Would someone please post and example of how one would add an ASP.net AJAX component to a portal page.

User avatar
Member
Member
chris-ricochetpartners - 9/19/2008 8:24:02 AM
   
RE:ASP.net AJAX in Portal
I figured this out. For the benefit of other users, the way I accomplished adding an Ajax Control Toolkit Accordion control was to create a new web part, then add the control into the web part. One word of warning however, I am using VS 2008, which has .net 3.5 components installed natively. On my first try I added the control from my toolbar by dragging and dropping onto the form. DO NOT MAKE THIS MISTAKE. It took me most of the rest of the day unwinding what happened. VS added the 3.5 DLL to the project automatically and created the references to these DLLs. When I tried to build the site, I got a bunch of conflicting DLL messages. Ultimately I had to delete all the DLL's and re-add from a demo project then do the same in the references property panel.

After all that, I closely examined the web.config and found that the Ajax Control Toolkit was already a referenced assembly via the ajaxToolkit: identifier. So rather than dragging and dropping the control I hand coded <ajaxToolkit:Accordion id... ></ajaxToolkit:Accordion> and viola! I had the control I was intending to create from the get go.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/19/2008 8:55:04 AM
   
RE:ASP.net AJAX in Portal
Hi,

Here you can find information about how to prepare .Net 3.5 DLL files for the latest AJAX toolkit - http://devnet.kentico.com/Knowledge-Base/AJAX/How-to-prepare--NET-3-5-(AJAX-3-5-0-0)-package-for.aspx

You can use AJAX in Kentico CMS in usual way as it is used in other ASP.Net applications.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
chris-ricochetpartners - 9/19/2008 11:16:17 AM
   
RE:ASP.net AJAX in Portal
Hello,

Thanks for the response. The referenced FAQ lacks details of which I could not figure out a workaround.


5. Delete all dlls from "BIN" folder starting with "CMS". Please delete also "AjaxControlToolkit.dll", "System.Web.Extensions.dll" and "System.Web.Extensions.Design.dll".

I delete all of the CMS. dll's, however the document does not indicate to re-add the dll's or where to re-add them from so step 8 fails.

8. In the end please rebuild solution in "release" mode.


Please advise on how to accomplish the build.

User avatar
Member
Member
chris-ricochetpartners - 9/19/2008 12:34:47 PM
   
RE:ASP.net AJAX in Portal
After trying this process again without deleting the CMS dll's and modifying my web.config I continue to get this error:

Error 18 Could not load file or assembly 'System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I modified the web.config by comparing to a working 3.5 project and making the adds/changes to the file:

web.config
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
<!-- Content staging BEGIN -->
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<!-- Content staging END -->
</configSections>
<appSettings>
<add key="CMSProgrammingLanguage" value="C#"/>
<add key="CMSTrialKey" value="CE03-20081009-2+OBo2"/>
<add key="WS.webservice" value="http://localhost/WebService/webservice.asmx"/>
<add key="CMSUseIFrameForHTMLEditorToolbar" value="true"/>
<add key="CMSDefaultSpellCheckerCulture" value="en-US"/>
<add key="CMSRenderGeneratorName" value="true"/>
</appSettings>
<connectionStrings>
<clear/>
</connectionStrings>
<system.web>
<pages validateRequest="false">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<!-- <add tagPrefix="ajaxToolkit" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> -->
<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
<add tagPrefix="cms" namespace="CMS.Controls" assembly="CMS.Controls"/>
<add tagPrefix="cms" namespace="CMS.FormEngine" assembly="CMS.FormEngine"/>
<add tagPrefix="cms" namespace="CMS.ExtendedControls" assembly="CMS.ExtendedControls"/>
<add tagPrefix="cms" namespace="CMS.PortalControls" assembly="CMS.PortalControls"/>
</controls>
<namespaces>
<add namespace="CMS.CMSHelper"/>
<add namespace="CMS.GlobalHelper"/>
</namespaces>
</pages>
<customErrors defaultRedirect="~/CMSMessages/error.aspx" mode="Off">
<error statusCode="404" redirect="~/CMSPages/handler404.aspx"/>
</customErrors>
<authentication mode="Forms">
<forms loginUrl="CMSPages/logon.aspx" defaultUrl="Default.aspx" name=".ASPXFORMSAUTH" timeout="60000" slidingExpiration="true"/>
</authentication>
<httpRuntime maxRequestLength="10000"/>
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US"/>
<membership defaultProvider="CMSProvider" userIsOnlineTimeWindow="30">
<providers>
<clear/>
<add name="CMSProvider" type="CMS.MembershipProvider.CMSMembershipProvider" connectionStringName="CMSConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed"/>
</providers>
</membership>
<roleManager defaultProvider="CMSRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
<providers>
<clear/>
<add name="CMSRoleProvider" type="CMS.MembershipProvider.CMSRoleProvider" connectionStringName="CMSConnectionString" applicationName="SampleApplication" writeExceptionsToEventLog="false"/>
</providers>
</roleManager>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="XHtmlModule" type="CMS.CMSOutputFilter.OutputFilterModule, CMS.OutputFilter"/>
</httpModules>
<xhtmlConformance mode="Strict"/>
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>
<compilation debug="false" numRecompilesBeforeAppRestart="100">
<assemblies>
<add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Configuration.Install, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<!-- <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> -->
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
<!-- Different programming languages BEGIN -->
<!--<codeSubDirectories>
<add directoryName="CSCode"></add>
<add directoryName="VBCode"></add>
</codeSubDirectories>-->
<!-- Different programming languages END -->
</compilation>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/warnaserror-" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" compilerOptions="/optioninfer+" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
</compiler>
</compilers>
</system.codedom>
<!-- Windows authentication BEGIN -->
<!--
<location path="">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
-->
<!-- Windows authentication END -->
<!-- Content staging BEGIN -->
<microsoft.web.services3>
<security>
<securityTokenManager>
<add type="CMS.Staging.WebServiceAuthorization" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken"/>
</securityTokenManager>
<x509 allowTestRoot="true" verifyTrust="true"/>
</security>
<policy fileName="wse3policy.config"/>
<diagnostics>
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo"/>
</diagnostics>
</microsoft.web.services3>
<!-- Content staging END -->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="XHtmlModule" type="CMS.CMSOutputFilter.OutputFilterModule, CMS.OutputFilter"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/19/2008 12:48:39 PM
   
RE:ASP.net AJAX in Portal
Hi again,

could you please write us a message to support@kentico.com. I will try to create a DLL package and web.config file to use the AJAX Toolkit 3.5 for you.


Best Regards,
Juraj Ondrus