title: Custom Html Helper not working
body: <p>I am trying to learn MVC3 from Pro ASP.NET MVC3 Framework. But i am stuck at one place where we add custom Html Helper.</p>
  
  <p>I did every thing mentioned in the book, but i am not able to add the custom Html helper.</p>
  
  <p>Can somebody please help.</p>
  
  <p>Thanks </p>
  
  <p><strong>List.cshtml</strong></p>
  
  <pre><code>    @model SportsStore.WebUI.Models.ProductListViewModel          
  
  
  @{    
      ViewBag.Titke = "Product";
  }
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;List&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          @foreach (var p in Model.Products)
          {
              &lt;div class="item"&gt;
                  @p.Name
                  @p.Description
                  &lt;h4&gt;@p.Price.ToString("c")&lt;/h4&gt;                
              &lt;/div&gt;
          }
          &lt;div class="Pager"&gt;
          @Html.PageLinks(Model.pagingInfo, x =&gt; Url.Action("List", new {page = x}))
          &lt;/div&gt;
      &lt;/div&gt;    
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>PagingHelper.Cs</strong></p>
  
  <pre><code>using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using SportsStore.WebUI.Models;
  using System.Text;
  
  namespace SportsStore.WebUI.HtmlHelpers
  {
      public static class PagingHelper
      {
          public static MvcHtmlString PageLinks(HtmlHelper helper, PagingInfo pagingInfo, Func&lt;int, string&gt; pageUrl)
          {
              StringBuilder linkString = new StringBuilder();
              for (int i = 1; i &lt;= pagingInfo.TotalPages; i++)
              {
                  TagBuilder tag = new TagBuilder("a");
                  tag.MergeAttribute("href", pageUrl(i));
                  tag.InnerHtml = i.ToString();
                  if (i == pagingInfo.CurrentPage)
                  {
                      tag.AddCssClass("selected");
                  }
                  linkString.Append(tag.ToString());
              }
              return MvcHtmlString.Create(linkString.ToString());
  
          }
      }
  }
  </code></pre>
  
  <p><strong>Web.Config</strong></p>
  
  <pre><code> &lt;system.web.webPages.razor&gt;
      &lt;host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;pages pageBaseType="System.Web.Mvc.WebViewPage"&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.Mvc" /&gt;
          &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
          &lt;add namespace="System.Web.Mvc.Html" /&gt;
          &lt;add namespace="System.Web.Routing" /&gt;
      &lt;add namespace="SportsStore.WebUI.HtmlHelpers" /&gt; 
        &lt;/namespaces&gt;
      &lt;/pages&gt;
    &lt;/system.web.webPages.razor&gt;
  </code></pre>