in my _Layout.cshtml i have this html code
@using PreVenta
<li class="@Html.ActivePage("Home")">
<a href="@Url.Action("Index", "Home")">
<i class="fa fa-home"></i>
<span class="title">Home</span>
<span class="@Html.SelectedPage("Home")" />
</a>
</li>
and i have a helper to detect the current active page
public static string ActivePage(this HtmlHelper helper, string controller)//, string action)
{
string classValue = "";
string currentController = helper.ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString();
//string currentAction = helper.ViewContext.Controller.ValueProvider.GetValue("action").RawValue.ToString();
if (currentController.ToLower() == controller.ToLower()) // && currentAction == action)
{
classValue = "start active";
}
return classValue;
}
the main problem is when i try to launch mi webapp, i get this error Compiler Error Message: CS1061: 'System.Web.Mvc.HtmlHelper ' does not contain a definition for 'ActivePage' no extension method 'ActivePage' accepting a first argument of type 'System.Web is not found. Mvc.HtmlHelper '(are you missing a using directive or an assembly reference?).
please some can help me, because i'm very confused. thanks