This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SharePointWebControls:ListItemProperty ID="CustomListItemProperty1" Property="LookupFieldName_x003a_Title" runat="server" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Xml; | |
using Microsoft.SharePoint; | |
using Microsoft.SharePoint.WebPartPages; | |
using System.Xml.XPath; | |
using System.Web.UI.WebControls.WebParts; | |
namespace MySharePoint.Features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ElementManifests> | |
<!-- Configurations --> | |
<ElementFile Location="configuration.xml"/> | |
<!-- WebParts --> | |
<ElementFile Location="Example.webpart" /> | |
</ElementManifests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<Configuration> | |
<Page FileName="pages/default.aspx"> | |
<WebPart Id="00000000-0000-0000-0000-000000000000" ZoneId="Left" Index="1" FileName="Example.webpart" Type="Definition" /> | |
<WebPart Id="00000000-0000-0000-0000-000000000000" ZoneId="Right" Index="1" FileName="" Type="ListView" ListName="Announcements" /> | |
</Page> | |
<Page FileName="pages/AnotherPage.aspx"> | |
<WebPart Id="00000000-0000-0000-0000-000000000000" ZoneId="Main" Index="1" FileName="Example.webpart" Type="Definition" /> | |
</Page> | |
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
// Get the limitedWebPartManager of the page layout file. | |
using (SPLimitedWebPartManager wpManager = page.File.GetLimitedWebPartManager(PersonalizationScope.Shared)) | |
{ | |
// cycle through each web part and get the different attributes | |
foreach (XPathNavigator webPartConfiguration in pageLayoutConfiguration.Select("WebPart")) | |
{ | |
string errorMsg = null; | |
string webPartFilename = webPartConfiguration.GetAttribute("FileName", ""); |