Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Unable to cast object of type MyWebpart to type 'CMS.PortalControls.CMSAbstractWebPart'. View modes: 
User avatar
Member
Member
christophe - 6/25/2009 3:41:18 AM
   
Unable to cast object of type MyWebpart to type 'CMS.PortalControls.CMSAbstractWebPart'.
Hi,

We are having a very unusual error on one of our custom webpart
We can't change the layout and create a new one without changing anything :
the error we get is the following :
[Error loading the WebPart 'MyNewsletterSubcriptions']
Unable to cast object of type 'ASP.cmswebpartlayouts_8e331d47_cb6b_43ab_a992_0bda4a169dda_penguin_mynewslettersubcriptions___test_ascx' to type 'CMS.PortalControls.CMSAbstractWebPart'.

It works fine when switching back the default layout.

Any idea Anyone?
Cheers.



User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/1/2009 3:50:48 AM
   
RE:Unable to cast object of type MyWebpart to type 'CMS.PortalControls.CMSAbstractWebPart'.
Hello,

Unfortunately, this is quite a common error message.

Could you please try to delete the .Net cache? Could you please also take a look into the Event log, if there is something more about the error? Could you please describe further, what are the changes in the layout?

Best Regards,
Boris Pocatko

User avatar
Member
Member
shivam-inorbital - 10/9/2010 12:53:29 AM
   
RE:Unable to cast object of type MyWebpart to type 'CMS.PortalControls.CMSAbstractWebPart'.
Hello Sir,

I am experiencing a similar problem. I am created a webpart with regular c# to connect to custom table. Is it possible to get data like that?

Thanks.

User avatar
Member
Member
shivam-inorbital - 10/9/2010 1:06:21 AM
   
RE:Unable to cast object of type MyWebpart to type 'CMS.PortalControls.CMSAbstractWebPart'.
shivam-inorbital wrote: Hello Sir,

I am experiencing a similar problem. I created a webpart with regular c# to connect to custom table. Is it possible to get data like that?

Thanks.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 10/12/2010 8:02:31 AM
   
RE:Unable to cast object of type MyWebpart to type 'CMS.PortalControls.CMSAbstractWebPart'.
Hello,

Yes, this shouldn't be a problem. There is a section of the Developer's guide which describes how to manage the custom tables records with the API.

Best regards,
Boris Pocatko