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 Technologies5