title: Edit the innerhtml of a <li> to add an <i> tag with icon image
body: <p>I have created a custom helper for tracking the current menu item in my MVC application and would now like to replace the icons I was using before the change and set the relevant href. Previously my list items looked like this:</p>
  
  <pre><code>&lt;li&gt;&lt;a href="@Url.Action("Index", "Admin")"&gt;&lt;i class="icon-lock"&gt;&lt;/i&gt;Admin&lt;/a&gt;&lt;/li&gt;            
  &lt;li&gt;&lt;a class="active" href="@Url.Action("Index", "Home")"&gt;&lt;i class="icon-home"&gt;&lt;/i&gt;Home&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>I now have created the generic menu item by using the following code:</p>
  
  <pre><code>using System;
  using System.Web.Mvc;
  using System.Web.Mvc.Html;
  
  namespace MetaLearning.Helpers
  {
    public static class MenuExtensions
    {
      public static MvcHtmlString MenuItem(this HtmlHelper htmlHelper,
                                           string text, string action,
                                           string controller,
                                           string iconClass,
                                           object routeValues = null,
                                           object htmlAttributes = null)
      {
          var li = new TagBuilder("li");
          var routeData = htmlHelper.ViewContext.RouteData;
          var currentAction = routeData.GetRequiredString("action");
          var currentController = routeData.GetRequiredString("controller");
          li.InnerHtml = @"&lt;a class=""active"" href=""/""&gt;&lt;i class=""icon-home""&gt;&lt;/i&gt;Home&lt;/a&gt;";
          if (currentController.Contains(text))
          {
              li.InnerHtml = @"&lt;a class=""active"" href=""/""&gt;&lt;i class=""icon-home""&gt;&lt;/i&gt;"+ text + "&lt;/a&gt;";
          }
          else
          {
              li.InnerHtml = @"&lt;a href=""/""&gt;&lt;i class=""icon-home""&gt;&lt;/i&gt;" + text + "&lt;/a&gt;";
          }
  
          return MvcHtmlString.Create(li.ToString());
      }
    }
  }
  </code></pre>
  
  <p>How can I set the href to the "/controller" and the name of the icon to iconClass. I have tried the following:</p>
  
  <pre><code>li.InnerHtml = @"&lt;a class=""active"" href=""/""&gt;&lt;i class=""icon-home""&gt;&lt;/i&gt;"+ text + "&lt;/a&gt;";
  </code></pre>
  
  <p>With this I am successfully showing the correct text but when I try to replace the href or icon class names with the relevant variables my string formation is incorrect</p>