1

I have this code:

using (SPLimitedWebPartManager mgr = page.GetLimitedWebPartManager PersonalizationScope.Shared))
{
   foreach (System.Web.UI.WebControls.WebParts.WebPart wp in mgr.WebParts)
   {
       if (wp.Zone != null)){

       // ........
   }

   //.......
}

I have the wp.Zone = null, why is that, although in debugging I can see the name for the webpart and everything except for the Zone = null.

0

Hmm... You can also get Zone ID of the web part this way:

var zoneId = mgr.GetZoneID(wp);

What do you intend to do with Zone object by the way?

Sanjay

0
0

One of the reasons for this could be that webparts are closed the page

Sanjay

1
  • Hi Sanjay, thanks for your answer, no I just places the webpart on the page, in the header zone.. that's it. it's not closed webpart. – SharePoint Freak Mar 13 '13 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.