November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Are you sure every page has a property called "PartnerName"? If a page doesn't have this property, pd will be null.
If it DOES have this property, but it doesn't have a value entered, pd.Value will be null, which means your ToString() call will fail.
Summary --
Thanks
Ok,I got the reason for this i.e pages are not published.If i publish pages than its working fine.
Could we get only Published pages using FindPagesWithCriteria?
Use FilterPublish or FilterForVisitor (EPiServer.Filters namespace) to filter your PageDataCollection before the loop.
Hello
I am getting pages of particular pagetype as PageDataCollection using findpageswithcriteria.
Now i want the value of property in a for loop like this but i am getting error
PageDataCollection _PageItems = DataFactory.Instance.FindPagesWithCriteria(PageReference.RootPage, criterias);
foreach (var partnerInfo in _PageItems)
{
PropertyData pd = partnerInfo.Property["PartnerName"];
if (pd != null && pd.IsNull == false)
string partner = pd.Value.ToString();
}
Any body can help me to solve this issue.