Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Object reference not set to an instance of an object. View modes: 
User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 12:54:54 AM
   
Object reference not set to an instance of an object.
I upgraded my kentico based website from version 5.5R2 to 6.0 using upgrade installer downloaded from kentico.

I got a message of successful upgradation but on accessing my website, i am getting error 'Object reference not set to an instance of an object.'

Actually, i have created custom webparts using editableImage and editabletext webparts. Using, these custom webparts, i have created New page templates and inserted contents. Till version 5.5R2, everything was working fine but on upgrading to 6.0, these pages where i m using my custom page templates are not working and giving an error 'Object reference not set to an instance of an object.'

http://build.platformcentre.com:8080/

Kindly, assist us. We are ultimate license holders.

User avatar
Member
Member
Luke - 11/9/2011 2:04:45 AM
   
RE:Object reference not set to an instance of an object.
Hi there,

It could be due the fact you are running Kentico 6.0 under .NET 2.0. You may notice on the Kentico 6 for Developers page there is a bullet point that says: .NET 3.5 SP1 and .NET 4.0 (.NET 2.0 is no longer supported in version 6).

I would attempt to ensure your server meets Kentico 6 requirements, see if that helps and then post again if you still receive error messages.

Best Wishes,
Luke

User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 2:09:02 AM
   
RE:Object reference not set to an instance of an object.
I am using .Net 3.5. Moreover, cmsdesk and cmssitemanagers are working fine.

Moreover, i tried creating a custom webparts using editabletext webpart. On using this webpart on page, i m getting 'Object reference not set to an instance of an object' exception

User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 2:30:06 AM
   
RE:Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an object.]
CMS.PortalControls.CMSAbstractEditableWebPart.LoadContent(PageInfo pageInfo, Boolean forceReload) +51
CMS.PortalControls.CMSAbstractEditableWebPart.LoadContent(PageInfo pageInfo) +12
CMS.PortalControls.CMSPagePlaceholder.LoadRegionsContent(Boolean loadChildren) +127
CMS.PortalControls.CMSPagePlaceholder.OnLoad(EventArgs e) +36
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

User avatar
Member
Member
Luke - 11/9/2011 3:10:19 AM
   
RE:Object reference not set to an instance of an object.
Hi,

The reason i mentioned .NET 2.0 is because browsing to http://build.platformcentre.com:8080/ showed the version to be 2.0.50727.5448 and I had object reference errors on a site I have created previously for the very same reason; I can see your login page for CMSDesk & CMSSiteManager appear correctly as you mention however.

I'll see if I can work out the error message you posted above, if not maybe someone from Kentico may have an idea?

Best Wishes,
Luke

User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 3:21:32 AM
   
RE:Object reference not set to an instance of an object.
Is there any Kentico person who can resolve thsi issue?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/9/2011 3:49:57 AM
   
RE:Object reference not set to an instance of an object.
Hello,

Could you please double check your web.config file if there are any assemblies using a lower .NET version? Here is an example of an assembly entry. The highlighted number needs to be 3.5.0.0 or higher:
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

Please check the whole file for such a number.
Additionally, could you please check the version of the dll files in your bin folder?

Best regards,
Boris Pocatko

User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 4:56:46 AM
   
RE:Object reference not set to an instance of an object.
See everthing is working fine except those pages where i have used my custom webpart.

Design of my webpart is as follows :
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="2RowActivityBanner.ascx.cs"
Inherits="CMSWebParts_TAC_2RowActivityBanner" %>
<%@ Register Src="../Text/editableimage.ascx" TagName="editableimage" TagPrefix="uc1" %>
<%@ Register Src="../Text/editabletext.ascx" TagName="editabletext" TagPrefix="uc2" %>
<uc2:editabletext ID="editableImage" runat="server" RegionType="HtmlEditor" HtmlAreaToolbarLocation="Out:FCKToolbar"
RegionTitle="Image" DialogHeight="80" />
<div class="welcome-msg">
<uc2:editabletext ID="editableBannerText" runat="server" RegionTitle="Banner Text"
RegionType="HtmlEditor" HtmlAreaToolbarLocation="Out:FCKToolbar" DialogHeight="30" />
</div>
<a class="register-button" title="Register to TaC" href="~/Member-Registration.aspx"
runat="server">Register to TaC</a>

Code of the webpart is as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMS.PortalControls;
public partial class CMSWebParts_TAC_2RowActivityBanner : CMSAbstractWebPart
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Page_Init(object sender, EventArgs e)
{

this.editableImage.ID = "Image_" + this.ID;
this.editableBannerText.ID = "Bannertext" + this.ID;
}
}

I have updated my Kentico to Framework 4.0 and replaced the DLL's of my application with Framework 4.0 DLL as provided by Kentico. Web.config has been updated:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<!-- 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="WS.webservice" value="http://localhost/WebService/webservice.asmx" />
<add key="CMSTrialKey" value="CX06-20110930-URhdsl" />
<add key="ChartImageHandler" value="storage=session;timeout=20;" />
<add key="CMS55Compatibility" value="true"/>
</appSettings>
<connectionStrings>
<clear />
<add name="CMSConnectionString" connectionString="Persist Security Info=False;database=XXXX;server=XXX.XXX.XXX.XXX;user id=XXXXX;password=XXXXX;Current Language=English;Connection Timeout=240;" />
</connectionStrings>
<system.web>
<pages validateRequest="false" clientIDMode="AutoID">
<controls>
<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.FormControls" assembly="CMS.FormControls" />
<add tagPrefix="cms" namespace="CMS.ExtendedControls" assembly="CMS.ExtendedControls" />
<add tagPrefix="cms" namespace="CMS.PortalControls" assembly="CMS.PortalControls" />
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization" />
</controls>
<namespaces>
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="CMS.CMSHelper" />
<add namespace="CMS.GlobalHelper" />
</namespaces>
</pages>
<customErrors defaultRedirect="~/CMSMessages/error.aspx" mode="Off">
<error statusCode="404" redirect="~/CMSMessages/PageNotFound.aspx" />
</customErrors>
<authentication mode="Forms">
<forms loginUrl="CMSPages/logon.aspx" defaultUrl="Default.aspx" name=".ASPXFORMSAUTH" timeout="60000" slidingExpiration="true" />
</authentication>
<httpRuntime maxRequestLength="2097151" waitChangeNotification="1" maxWaitChangeNotification="3600" requestValidationMode="2.0" maxUrlLength="1000" />
<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>
<add path="ChartImg.axd" verb="*" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>
<httpModules>
<add name="XHtmlModule" type="CMS.CMSOutputFilter.OutputFilterModule, CMS.OutputFilter" />
<add name="CMSApplicationModule" type="CMS.CMSHelper.CMSApplicationModule, CMS.CMSHelper" />
</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" targetFramework="4.0">
<assemblies>
<add assembly="SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="Microsoft.Transactions.Bridge, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Deployment, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Messaging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.IdentityModel.Selectors, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.ServiceProcess, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
<!-- Different programming languages BEGIN -->
<!--
<codeSubDirectories>
<add directoryName="CSCode"></add>
<add directoryName="VBCode"></add>
</codeSubDirectories>
-->
<!-- Different programming languages END -->
</compilation>
<httpCookies httpOnlyCookies="true" />
</system.web>
<!-- Windows authentication BEGIN -->
<!--
<location path="">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
-->
<!-- Windows authentication END -->
<location path="cms">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<!-- WebDAV location BEGIN -->
<location path="cms/files">
<system.web>
<httpHandlers>
<clear />
<add verb="*" path="*" type="CMS.WebDAV.WebDAVHandler, CMS.WebDAV" />
</httpHandlers>
<httpRuntime executionTimeout="2400" maxRequestLength="2097151" />
</system.web>
<system.webServer>
<handlers>
<clear />
<add name="CMSWebDAVHandler" path="*" verb="*" type="CMS.WebDAV.WebDAVHandler, CMS.WebDAV" />
<remove name="xoml-Integrated" />
<add name="*.vbhtml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.vbhtml" type="System.Web.HttpForbiddenHandler" />
<add name="*.vbhtm_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.vbhtm" type="System.Web.HttpForbiddenHandler" />
<add name="*.cshtml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.cshtml" type="System.Web.HttpForbiddenHandler" />
<add name="*.cshtm_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.cshtm" type="System.Web.HttpForbiddenHandler" />
<add name="*.xamlx_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.xamlx" type="System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.xoml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.xoml" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.svc_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.svc" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.soap_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="*.rem_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="*.asmx_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ScriptResource.axd" preCondition="integratedMode,runtimeVersionv2.0" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*_AppService.axd_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="eurl.axd_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="eurl.axd" type="System.Web.HttpNotFoundHandler" />
</handlers>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
</location>
<!-- WebDAV location END -->
<!-- Content staging BEGIN -->
<microsoft.web.services3>
<security>
<securityTokenManager>
<add type="CMS.Synchronization.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>
<modules>
<remove name="WebDAVModule" />
<remove name="XHtmlModule" />
<remove name="CMSApplicationModule" />
<remove name="UrlRoutingModule" />
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,System.Web.Routing, Version=3.5.0.0,Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="XHtmlModule" type="CMS.CMSOutputFilter.OutputFilterModule, CMS.OutputFilter" />
<add name="CMSApplicationModule" preCondition="managedHandler" type="CMS.CMSHelper.CMSApplicationModule, CMS.CMSHelper" />
<add name="ErrorHandlerModule" preCondition="managedHandler" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
<handlers>
<remove name="MetaWeblogAPI" />
<remove name="UrlRoutingHandler" />
<add name="MetaWeblogAPI" preCondition="integratedMode" verb="*" path="MetaWeblog.ashx" type="CMS.MetaWeblogProvider.MetaWeblogAPI, CMS.MetaWeblogProvider" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v4.0"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v4.0"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
</configuration>

Everything was running fine with Kentico version 5.5R2. . We urgently need to resolve our issue without de-grading our application to 5.5R2 as we have ultimate license of 6.0 version too.

Check the link :

http://build.platformcentre.com:8080/

ERROR :
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
CMS.PortalControls.CMSAbstractEditableWebPart.LoadContent(PageInfo pageInfo, Boolean forceReload) +56
CMS.PortalControls.CMSAbstractEditableWebPart.LoadContent(PageInfo pageInfo) +14
CMS.PortalControls.CMSPagePlaceholder.LoadRegionsContent(Boolean loadChildren) +126
CMS.PortalControls.CMSPagePlaceholder.OnLoad(EventArgs e) +36
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/9/2011 5:29:39 AM
   
RE:Object reference not set to an instance of an object.
Hello,

Thank you for the additional information. The web.config file seems to be correct.
Please try to run the site in debug mode in Visual Studio so the exception is thrown directly over the code which is causing the issue.

Best regards,
Boris Pocatko

User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 6:07:16 AM
   
RE:Object reference not set to an instance of an object.
File is located at \CMSWebParts\Text\editableimage.ascx.cs
public override void LoadContent(PageInfo pageInfo, bool forceReload)
{
if (pageInfo == null)
{
return;
}

// Get the content
PageInfo sourceInfo = pageInfo;

// Prepare the ID
string id = this.PartInstance.ControlID.ToLower();
if (this.InstanceGUID != Guid.Empty)
{
id += ";" + this.InstanceGUID.ToString().ToLower();
if (this.PartInstance.CurrentVariantInstance != null)
{
id += "(" + this.PartInstance.CurrentVariantInstance.ControlID + ")";
}
else if (this.IsWidget && this.IsVariant)
{
id += "(" + this.PartInstance.ControlID + ")";
}
}

string content = ValidationHelper.GetString(pageInfo.EditableWebParts[id], "");

// Load the content if published
if ((CMSContext.ViewMode != ViewModeEnum.LiveSite) || !this.SelectOnlyPublished || ((sourceInfo != null) && sourceInfo.IsPublished))
{
LoadContent(content, forceReload | PortalContext.MVTCombinationPanelChanged);
}
}

User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 6:12:19 AM
   
RE:Object reference not set to an instance of an object.
if ((CMSContext.ViewMode != ViewModeEnum.LiveSite) || !this.SelectOnlyPublished || ((sourceInfo != null) && sourceInfo.IsPublished))
{
LoadContent(content, forceReload | PortalContext.MVTCombinationPanelChanged);
}
}

at this line of code, it is giving exception
[NullReferenceException: Object reference not set to an instance of an object.]
CMS.PortalControls.CMSAbstractEditableWebPart.LoadContent(PageInfo pageInfo, Boolean forceReload) +88
CMS.PortalControls.CMSAbstractEditableWebPart.LoadContent(PageInfo pageInfo) +43
CMS.PortalControls.CMSPagePlaceholder.LoadRegionsContent(Boolean loadChildren) +186
CMS.PortalControls.CMSPagePlaceholder.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

User avatar
Member
Member
Luke - 11/9/2011 6:55:53 AM
   
RE:Object reference not set to an instance of an object.
Hi Guys,

It wouldn't be to do with the fact FCKEditor was replaced with CKEditor in version 6.0 would it? I notice in the control declaration it mentions FCKToolbar:
<uc2:editabletext ID="editableImage" runat="server" RegionType="HtmlEditor" HtmlAreaToolbarLocation="Out:FCKToolbar"
RegionTitle="Image" DialogHeight="80" />

I'm assuming that now FCKEditor is CKEditor the location FCKToolbar would return as null?

A curious problem to say the least, I hope you are able to come to a simple solution!

Best Wishes,
Luke

User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 7:38:05 AM
   
RE:Object reference not set to an instance of an object.
Then, what i should do now?

i don't want lo lose the data at any cost.

Waiting for solution from kentico experts.................

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/9/2011 8:58:48 AM
   
RE:Object reference not set to an instance of an object.
Hello,

The FCKEditor reference shouldn't be causing this, since it is still used in the 6.0 version of Kentico. Could you please let me know which exact variable is not initialized?

Best regards,
Boris Pocatko

User avatar
Member
Member
ranjan.kumar-thepsi - 11/9/2011 10:58:03 PM
   
RE:Object reference not set to an instance of an object.
Hi,

I had sent you every information regarding error.I am not getting any right answer from kentico side.

1) Should I assume that Kentico 6.0 up-gradation is still incomplete?
2) I have to intimate my client who had bought ultimate license for Kentico 6.0.
3) Or Should I degrade my application in 5.5R2?

Regards
Ranjan Kumar

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/10/2011 1:30:42 AM
   
RE:Object reference not set to an instance of an object.
Hello,

1) No, the upgrade procedure should be working fine.
2) I am sorry to hear that, but we are trying to do our best. If the issue is caused by a custom web part then we simply can't tell what exactly is wrong without looking at the web part directly.
3) No, degrading the application won't solve your problems at this stage, if you wan't to upgrade your project in future, you will have to sort this still out.

Could you please upload the web part which is causing the issues somewhere online, so I can download it and take a look at it?
If this doesn't work for you, could you please open a support issue by filling out this form and attaching the custom web part to it?

Best regards,
Boris Pocatko

User avatar
Member
Member
ranjan.kumar-thepsi - 11/10/2011 1:51:11 AM
   
RE:Object reference not set to an instance of an object.
I have already provided the code along with design in earlier posts. Please have a look and create a custom webpart using that.

I have done few other experiments stating that there is some problem in 'editableimage.ascx.cs' and 'editabletext.ascx.cs.

Talking about opening a support issue, i had already done that yesterday but still no response.

Now things are seems to be bit frustrating as i haven't got an actual solution despite of series of posts .

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/10/2011 5:05:07 AM
   
RE:Object reference not set to an instance of an object.
Hello,

I did some digging around and it seems that the EditableRegion web part was changed in the 6.0 version. Please modify your code so you will be using the control directly, not the web part. So instead this code:
<uc2:editabletext ID="editableBannerText" runat="server" RegionTitle="Banner Text" RegionType="HtmlEditor" HtmlAreaToolbarLocation="Out:FCKToolbar" DialogHeight="30"  />

use this one:
<cms:CMSEditableRegion ID="editableBannerText" runat="server" RegionType="HtmlEditor" DialogHeight="200" RegionTitle="Banner Text" EnableViewState="false" HtmlAreaToolbarLocation="Out:FCKToolbar" />

Best regards,
Boris Pocatko

User avatar
Member
Member
ranjan.kumar-thepsi - 11/10/2011 5:32:40 AM
   
RE:Object reference not set to an instance of an object.
Thanks for the extended help and kind support. It is working fine but again i am sorry to say that my data is lost.

Kindly, suggest me the way to recover the data.

Best regards,
Ranjan

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/10/2011 6:29:56 AM
   
RE:Object reference not set to an instance of an object.
Hello,

The data should be still available in the database, if they weren't overwritten (e.g. by clicking the save button). Please check the DocumentContent column in the database table CMS_Document for the page, where the web part is placed. You can retrieve the document by using the Document name of the document:
SELECT * FROM CMS_Document WHERE DocumentName LIKE '%Home%'

Best regards,
Boris Pocatko

User avatar
Member
Member
ranjan.kumar-thepsi - 11/11/2011 6:17:10 AM
   
RE:Object reference not set to an instance of an object.
I have created a webpart but content is not visible to guest user or anonymous user.

My webpart is as follows:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="2RowActivityBanner.ascx.cs"
Inherits="CMSWebParts_TAC_2RowActivityBanner" %>
<cms:CMSEditableRegion ID="editableImage" runat="server" RegionType="HtmlEditor"
DialogHeight="80" RegionTitle="Image" EnableViewState="false" HtmlAreaToolbarLocation="Out:FCKToolbar" />
<div class="welcome-msg">
<cms:CMSEditableRegion ID="editableBannerText" runat="server" RegionType="HtmlEditor"
DialogHeight="30" RegionTitle="Banner Text" EnableViewState="false" HtmlAreaToolbarLocation="Out:FCKToolbar" />
</div>
<a class="register-button" title="Register to TaC" href="~/Member-Registration.aspx"
runat="server">Register to TaC</a>

The content added to these EditableRegions are not visible to users except admin.

Please help..its urgent....

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 11/11/2011 8:00:03 AM
   
RE:Object reference not set to an instance of an object.
Hello,

Could you please try to add some content before text so you can make sure the web part is rendered in both cases?
Could you please try to add a new editable region with a different text and ID to check, if the data is displayed correctly?
Please also try to remove one of the editable regions.

Best regards,
Boris Pocatko