Error when trying to add a web part containing ActiveX markup  
Author Message
Dudley





PostPosted: SharePoint - Development and Programming, Error when trying to add a web part containing ActiveX markup Top

I have a web part that contains the markup for an activex control which gives the error "Object reference not set to an instance of an object" when I try to add the web part to a page in Sharepoint. Does anybody know what could cause this error

The web part runs fine in a normal ASP.NET 2.0 web page. The web part uses the RenderContent() method to output the relevant <OBJECT CLASSID=... syntax. However I did notice that in the Visual designer of ASP.NET the web part does not render properly and it gives the same "Object reference..." error.

I thought perhaps that the Visual Designer mode of ASP.NET and the edit page mode of Sharepoint might both be having trouble rendering the activex control so I put in some extra code to the web part to check whether it was in desgin mode or not. The fixed the problem in ASP.NET but the problem still remains in Sharepoint.

Is the RenderContent the best method on a web part to output the "<OBJECT CLASSID=..." syntax or am I doing something wrong I have added other web parts to Sharepoint fine so it definately seems to be related to the fact that this web part is hosting an Activex object.

Any help with this would be greatly appreciated as this is driving me nuts!



SharePoint Products and Technologies2  
 
 
Dudley





PostPosted: SharePoint - Development and Programming, Error when trying to add a web part containing ActiveX markup Top

(Bumping)

If anyone has had problems adding ASP.Net 2.0 web parts containing ActiveX controls to Sharepoint I would love to know any info you might have that may help me solve my problem :)


 
 
Qazi Mobeen





PostPosted: SharePoint - Development and Programming, Error when trying to add a web part containing ActiveX markup Top

The activeX control you are using is the .ocx one or the .NET one seems, in-case if you are using the .NET one, your path isn't fine enough to retrieve the appropriate control..