title: Creating and using DropDown custom extension in asp.net mvc 3
body: <p>I thought this would be a standard task but I get a lot of difficulties so I seek for assistance. </p>
  
  <p>I have a drop down that I use intensively in my views and now I have a lot of <code>@Html.DropDown()</code> with the same logic in it and I decided that it's a good place to replace this with a custom html extension.</p>
  
  <p>Instead of describing my project structure I'll just post a screenshot of it :</p>
  
  <p><img src="https://i.stack.imgur.com/8H9OA.png" alt="Project Structure"></p>
  
  <p>So in <code>HtmlExtensions.cs</code> I've created the method I think I need looking from an example somewhere on the net. The method looks like this :</p>
  
  <pre><code>public static MvcHtmlString YesNoNotApplicableDDown(this HtmlHelper html)
          {
              return MvcHtmlString.Create("&lt;select class=\"YesNoNotApplicable\"&gt; &lt;option value=\"1\"&gt;Yes&lt;/option&gt; &lt;option value=\"2\"&gt;No&lt;/option&gt;&lt;option value=\"3\"&gt;NotApplicable&lt;/option&gt;&lt;/select&gt;");
          }
  </code></pre>
  
  <p>Then I add the namespace in my <code>web.config</code> under <code>Views</code> :</p>
  
  <pre><code>&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="MCSResources" /&gt;
          &lt;add namespace="MaintenanceCheckSystem.Utils.HtmlExtensions" /&gt;
        &lt;/namespaces&gt;
      &lt;/pages&gt;
  </code></pre>
  
  <p>In fact I tried with and without the name of the project at the begining, so I tested this too :</p>
  
  <pre><code>&lt;add namespace="Utils.HtmlExtensions" /&gt;
  </code></pre>
  
  <p>Then in one of my views I tried <code>@Html.Ye..</code> but I don't get no hint, and when I checked my custom method wasn't there. I don't know if I miss something or I did something wrong (maybe both), so how can I make this work?</p>