have a little problem with this EPIServer error: CS1061: 'System.Web.UI.Control' does not contain a definition for 'CurrentPage' and no extension method 'CurrentPage' accepting a first argument of type 'System.Web.UI.Control' could be found (are you missing a using directive or an assembly reference?)
when i try to access a method with a parameter from my ascx file. The ascx file:
<div id="nav">
<ul role="menu">
<li <%# GetMenuClass(Container.CurrentPage)%> role="menuitem">
<%= GetNewsPage %>
<%--<a href="#">News</a>--%>
</li>
<li <%# GetMenuClass(Container.CurrentPage) %> role="menuitem">
<%= GetClientPage %>
<%--<a href="#">Clients</a>--%>
</li>
</ul>
</div>
The method in codebehind:
protected string GetMenuClass(PageData page)
{
if (page.IsSelected(CurrentPage))
{
return "class=\"menu-item selected\"";
}
return "class=\"menu-item\"";
}
what i want to achieve is something like this (if news page is selected):
<div id="nav">
<ul role="menu">
<li class="menu-item selected" role="menuitem"> News </li>
<li class="menu-item" role="menuitem">
<a href="#">Clients</a>
</li>
</ul>
</div>
</nav>
I'm greatful if some one can help.