November Happy Hour will be moved to Thursday December 5th.

asp:TreeView how do I get the links to my pages?

Vote:
 

Hi all!

Iam trying to do a sitemap. The layout of the sitemap calls for an asp:TreeView because of the, well, tree design our designer wants. Here is my code


// Front end

<EPiServer:PageDataSource runat="server" ID="websiteMapTreePages" IncludeRootPage="false" EnableVisibleInMenu="false" />
<asp:TreeView ID="websiteMapTree" Runat="server" DataSourceID="websiteMapTreePages">
     <DataBindings>
             <asp:TreeNodeBinding TextField="PageName" ValueField="PageLink" />
     </DataBindings>
</asp:TreeView>

// Back end

protected void Page_Load(object sender, EventArgs e)
{
websiteMapTreePages.PageLink = CurrentPage["websiteMapTreeCTRL"] as PageReference ?? PageReference.StartPage;
websiteMapTree.ExpandAll();
websiteMapTree.ShowExpandCollapse = false;
websiteMapTree.ShowLines = true;
}


The Pagetree looks good. The name of all the pages in my EpiServer site is displayed correctly. But I cant get the links to work. Is ValueField="PageLink" wrong? Am I missing something? NavigateUrl="http://www.google.se" works however.

Please, how do I get the links to work? I have tried many different attributes for the asp:TreeNodeBinding tag ...

 

Many thanks

#60040
Jul 12, 2012 0:45
Vote:
 

Of course if someone have another idea of doing a site map with the same design as the explorer in windows, using episerver controls and CSS, please let me know.

#60041
Jul 12, 2012 3:23
Vote:
 

NavigateUrlField="LinkUrl" did work. =/ He he.

Ok, but another question: when the site is viewed in swedish I only want the swedish version of pages to display, the same for english. Like a PageTree work. How do I do that?

#60042
Jul 12, 2012 3:44
Vote:
 

<EPiServer:PageDataSource UseFallbackLanguage="false" did seem to work. =)

Yes. This is pretty advanced stuff for me. If you have any comments on the code. please share. But evething seems to work now. Only CSS left for my beautiful site map.

#60043
Jul 12, 2012 3:54
* 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.