A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
<%@ control language="C#" autoeventwireup="true" codebehind="LeftMenu.ascx.cs" inherits="testSite.Web.templates.Controls.LeftMenu"> <%@ register tagprefix="EPiServer" namespace="EPiServer.WebControls" assembly="EPiServer">
<%# rendermenuitemcontainer.currentpage>
%#>
<%# rendermenuitemcontainer.currentpage>
%#>
<%# rendermenuitemcontainer.currentpage>%#>
%@>%@>And the code behind looks like this:namespace testSite.Web.templates.Controls { public partial class LeftMenu : Classes.testSiteUserControlBase { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { PageTreeControl.PageLink = new PageReference(TopMenuLevelId); PageTreeControl.DataBind(); } } public string RenderMenuItem(PageData pd) { if (pd.Property["MenuImage"].ToString().Length > 0) return String.Format("
", pd.Property["MenuImage"], pd.PageName);
return String.Format("{1}", pd.LinkURL, pd.PageName);
}
}
What I want to do is do show the FIRST two levels in the pagetree. If not klicked. Otherwise I want to expand the rest. Right now it displays all of the levels. And if I set ExpandAll="true" then all of the levels in the menu are displayed. I just want to display the first 2 levels. Anyone know how to do that? Kind regards, -- Jon