SPLimitedWebPartManager limitedWebPartManager = null;
SPList targetList = targetWeb.Lists["PromotedLink"];
XsltListViewWebPart listPomotedView = new XsltListViewWebPart();
listPomotedView.ListId = targetList.ID;
listPomotedView.ViewGuid = targetList.Views["Tiles"].ID.ToString("B").ToUpper();
limitedWebPartManager = targetWeb.GetLimitedWebPartManager(targetWeb.Url + "/" + "default.aspx", PersonalizationScope.Shared);
limitedWebPartManager.AddWebPart(listPomotedView, "Top", 3);
limitedWebPartManager.SaveChanges(listPomotedView);
targetWeb.Update();
SharePoint 2013 How to add Promoted link list view web part in page programmatically C#
Wednesday, June 12, 2013
Posted by Usama Wahab Khan at 10:43 PM
Labels: SharePoint 2013, SharePoint Development
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment