Exception trying to get a page URL from inside a PageTree

Vote:
 

Hi Guys,

I'm trying to get an EPiServer page URL from within an ItemTemplate in a PageTree control.

 I've tried the following:

<EPiServer:PageTree runat="server" ExpandAll="true" ID="SiteMapTree" PageLink="<%# IndexRoot %>">

<ItemTemplate>

<%# GetPageLink(Container.DataItem) %>

</ItemTemplate>

</EPiServer:PageTree>

 

The GetPageLink function just looks like this at the moment:

        protected string GetPageLink(object o)
        {

            return "";
        }

 But for some reason I always get the following exception:

Can't load property type 'EPiServerVanilla.IPSVSelector, EPiServerVanilla'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Does anyone know why this is happening or how I can achieve this? Please note: i only want the URL to the page not a link to it so I don't believe I can use <EPiServer:property ..>

Thanks in advance,

Jon

#30990
Jun 29, 2009 16:48
Vote:
 

Sorry if the above is a bit messed up. The exception is as follows:

Server Error in '/EPiServerVanilla' Application.

Can't load property type 'EPiServerVanilla.IPSVSelector, EPiServerVanilla'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: EPiServer.Core.EPiServerException: Can't load property type 'EPiServerVanilla.IPSVSelector, EPiServerVanilla'

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[EPiServerException: Can't load property type 'EPiServerVanilla.IPSVSelector, EPiServerVanilla']
   EPiServer.Core.PropertyData.CreatePropertyDataObject(String assemblyName, String typeName) +978
   EPiServer.DataAbstraction.PageDefinition.CreatePropertyData() +130
   EPiServer.Core.PropertyDataCollection.EnsureAllPageTypeProperties() +599
   EPiServer.Core.PropertyDataCollection.InitializeData() +99
   EPiServer.Core.PageData.InitializeData(IList`1 pageLanguages) +39
   EPiServer.DataAccess.PageListDB.ReadPageList(AbstractCommand cmd) +3018
   EPiServer.DataAccess.<>c__DisplayClass11.<LoadSpecificPages>b__10() +562
   EPiServer.DataAccess.<>c__DisplayClass1`1.<Execute>b__0() +77
   EPiServer.DataAccess.DatabaseFactory.Execute(Action`1 method) +84
   EPiServer.DataAccess.DataAccessBase.Execute(Action`1 action) +332
   EPiServer.DataAccess.PageListDB.LoadSpecificPages(Int32[] pageLinks) +132
   EPiServer.LocalPageProvider.GetPages(PageReferenceCollection pageReferences, ILanguageSelector selector) +306
   EPiServer.Core.PageProviderBase.GetScatteredPages(PageReferenceCollection pageRefs, ILanguageSelector selector) +532
   EPiServer.Core.PageProviderBase.GetChildren(PageReference pageLink, ILanguageSelector selector, Int32 startIndex, Int32 maxRows) +173
   EPiServer.DataFactory.GetChildren(PageReference pageLink, ILanguageSelector selector, Int32 startIndex, Int32 maxRows) +427
   EPiServer.DataFactory.GetChildren(PageReference pageLink) +64
   EPiServer.PageBase.GetChildren(PageReference pageLink) +92
   EPiServer.Web.WebControls.PageTreeData.GetChildrenForLoader(PageReference pageLink) +59
   EPiServer.Web.WebControls.HierarchicalPageLoader.GetFilteredChildren(PageReference pageLink) +78
   EPiServer.Web.WebControls.PageHierarchicalEnumerable.get_Pages() +60
   EPiServer.Web.WebControls.PageTree.CreateItemsRecursive(Int32 level, String path) +162
   EPiServer.Web.WebControls.PageTree.CreateChildControls() +184
   EPiServer.Web.WebControls.PageTreeData.DataBind() +364
   EPiServer.Web.WebControls.PageTreeData.OnPreRender(EventArgs e) +74
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

#30991
Jun 29, 2009 16:50
Vote:
 

<ItemTemplate>

 <%#Container.CurrentPage.LinkURL%>

</itemTemplate>

will give you the url. If will work if the pages is in the current language,

Guess the error you are getting is connected to another error case your code looks pretty error prof :)

#30992
Jun 29, 2009 19:55
Vote:
 
That worked perfectly, thanks Cool
#31006
Jun 30, 2009 11:47
Vote:
 

That looks like the same problem I've had - EPiServer doesn't compile a custom property / plugin

#36770
Feb 10, 2010 13:52
Vote:
 

The error will kick in if you have a property that are in  dll that isn't in the bin catalog. Remove the property in question or find the dll :)

#36784
Feb 10, 2010 15:46