tags:

views:

139

answers:

1

I have 3 Webpart namely WebPart-1.dwp, Webpart-2.dwp and WebPart-3.dwp.

When I have the following scenario:

WebPart-1 : WebPart-2 (Inheritance)
WebPart-2: Microsoft.SharePoint.WebPartPages.WebPart (Inheritance)

If I load WebPart-1, I will get to see the controls properly.

When I have the following scenario:

WebPart-1 : WebPart-2 (Inheritance)
WebPart-2 : WebPArt-3 (Inheritance)
WebPart-3 : Microsoft.SharePoint.WebPartPages.WebPart (Inheritance)

If I load WebPart-1, all the webparts do not get loaded properly and I get a Null reference exception.

In the WebPart-3, I have some custom code written to Render the webpart. I mean I have some Tables created, TD's and some TR's etc.

Any help on this would be greatly appreciable.

A: 

A likely culprit is your code inside WebPart-3. Try wrapping your render code and throwing a more meaningful exception than Null Reference Exception

Yuliy
I got this done. I was actually doing Controls.Add(Controls_ID) in WebPart-3 and not base.RenderWebPart. When I did the other way round it started working. Thanks for your time on this.
Nagendra