public static MvcHtmlString ActionLinkMenu(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, object routeValues = null, object htmlAttributes = null)
        {
            var currentAction     = htmlHelper.ViewContext.RouteData.GetRequiredString("action");
            var currentController = htmlHelper.ViewContext.RouteData.GetRequiredString("controller");

            var builder = new TagBuilder("li")
            {
                InnerHtml = htmlHelper.ActionLinkRaw(linkText, actionName, controllerName, routeValues, htmlAttributes).ToHtmlString()
            };

            if (controllerName == currentController && actionName == currentAction)
            {
                builder.AddCssClass("active");
            }

            return(new MvcHtmlString(builder.ToString()));
        }
 public static MvcHtmlString ActionLinkRaw(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, object routeValues, object htmlAttributes)
 {
     return(htmlHelper.ActionLinkRaw(linkText, actionName, controllerName, protocol, hostName, fragment, new RouteValueDictionary(routeValues), HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes)));
 }
 public static MvcHtmlString ActionLinkRaw(this HtmlHelper htmlHelper, string linkText, string actionName, RouteValueDictionary routeValues, IDictionary <string, object> htmlAttributes)
 {
     return(htmlHelper.ActionLinkRaw(linkText, actionName, null, routeValues, htmlAttributes));
 }
 public static MvcHtmlString ActionLinkRaw(this HtmlHelper htmlHelper, string linkText, string actionName, object routeValues, object htmlAttributes)
 {
     return(htmlHelper.ActionLinkRaw(linkText, actionName, null, new RouteValueDictionary(routeValues), HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes)));
 }
 public static MvcHtmlString ActionLinkRaw(this HtmlHelper htmlHelper, string linkText, string actionName, RouteValueDictionary routeValues)
 {
     return(htmlHelper.ActionLinkRaw(linkText, actionName, null, routeValues, new RouteValueDictionary()));
 }
 public static MvcHtmlString ActionLinkRaw(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName)
 {
     return(htmlHelper.ActionLinkRaw(linkText, actionName, controllerName, new RouteValueDictionary(), new RouteValueDictionary()));
 }