Try our conversational search powered by Generative AI!

call CurrentPage from property type definition


   EditCaption = "My property",
   Required = true,
   Type = typeof(MyCustomPropertyType)
public virtual string MyProperty { get; set; }

Inside my MyCustomPropertyType (subclass of PropertyLongString), can I in any way reference my CurrentPage (which is an instance of the page type
that contains MyProperty)?
(I need this because, based on its PageTypeID, I return a slightly different PropertyDataControl). Any workaround for this?

May 31, 2016 14:31

What this gives you back?

Jun 01, 2016 10:30

Valdis, thank you! Unfortunately I can't find Service Locator and PageRouteHelper in Epi 6 R2. Sorry for not specifying the version earlier.

Jun 01, 2016 11:11

Oh, well. I do not have v6 dlls at hand, but I at least can see that there is "PropertyLongString.PageLink" property in v9. That shold link you back to current page. Do you have similar property in v6?

Jun 01, 2016 11:28


This actually works fine when SAVING the page: DataFactory.Instance.GetPage(new PageReference(this.Parent[2].ToString())).PageName.ToString()
but the happiness was short-lived: it breaks when EDITING the page, because the this.parent[2] is evaluated differently then (an id which doesn't exist).
Makes me think this is to do with the fact the page wasn't saved the first time the method was invoked.
Also, another concern is referencing by index [2], in case the index changes in a subsequent Epi version in PropertyDataCollection types.

//later edit: Ah there it is. Can use PageParentLink instead of index 2

Edited, Jun 01, 2016 13:20
* 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.