I am trying to build an HtmlHelper extension in ASP.NET MVC RC2. This code worked fine in Preview 5, but does not work anymore in RC2 and I am trying to understand why. Here is the code:
public static string EmptyDropDownList(this HtmlHelper htmlHelper, string name, object htmlAttributes)
{
return htmlHelper.DropDownList(name, new SelectList(new string[0]), htmlAttributes);
}
The problem is that I am unable to access all the methods on htmlHelper from within the extension method. Thus, htmlHelper.DropDownList cannot be found.
Any suggestions?