how to compage properties which are pagereference

how to compage properties which are pagereference
Sep 17, 2008 15:43


You can get your property by creating a helper class like this:

public static PageReference GetPropertyPageReference(PageData pd, string propertyName)
            return ((pd[propertyName] as PageReference) ?? PageReference.EmptyReference);

 You call it like this:

PageReference pr = GetPropertyPageReference(YourPage, YourPropertyName);

 If your PageReferences isn't EmptyReference (PageReference.EmptyReference), then you can compare your PageReferences by using it's ID property like this:

If(PageRefOne.ID == PageRef2.ID)


//Do your thing


 OR use:


 -Kjetil Simensen

Edited, Sep 17, 2008 15:54

could I do something like: PropertyCriteria responsibilities = new PropertyCriteria();
                    responsibilities.Type = PropertyDataType.Pagereference;
                    responsibilities.Name = "Responsibilities";
                    responsibilities.Condition = CompareCondition.Equal;
                    responsibilities.Value = ????                    criteriaCollection.Add(responsibilities);

Sep 17, 2008 16:40

Not tried to use it in a FindPagesWithCriteria. Do you have to use this or can you make your own filter/search?


Sep 17, 2008 17:46

Hi Hua Wu!

Could you let us know what data type you selected in the combo box when you added the "Responsibilites" property.


Sep 17, 2008 18:23
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.