I am trying to build an HtmlHelper extension in ASP.NET MVC RC2. This code worked fine in Preview 5, but no longer works in RC2, and I'm trying to figure out 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 cannot access all the htmlHelper methods from the extension method. So htmlHelper.DropDownList could not be found.
Any suggestions?
source share