Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm having some problems with placement of my web parts. I have two different CEWP, which should be placed with zone index 0 and 1. However, after deployment both have the index 0. This is how I set the index in code:

            using (SPWeb web = site.OpenWeb())
            {
                SPLimitedWebPartManager webparts = web.GetLimitedWebPartManager(pageUrl, PersonalizationScope.Shared);
                var wp = new ContentEditorWebPart();
                wp.Hidden = false;
                wp.ContentLink = web.Site.ServerRelativeUrl + "SiteAssets/imageMap.html";
                wp.ChromeType = PartChromeType.None;
                webparts.AddWebPart(wp, "left", 1);
                webparts.SaveChanges(wp);
                web.Update();
            }
        }

How can I make the zone index "stick"?

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.