I’m trying to write my own little HTML helper which acts a lot like DropDownListFor but which doesn’t suffer from the same problems that I’ve encountered before. Let’s not discuss whether or not DropDownListFor is flawed—that is not what this question is about.
Anyways, what is the reason that the MVC guys make ToMvcHtmlString internal and not public?
My guess is to encourage you to use System.Web.HtmlString instead. But yes, I’ve wondered this myself and I’ve written a duplicate ToMvcHtmlString extension in my own helpers.
MvcHtmlString is, IIRC, just their compatibility fix so MVC 2 can work on both .NET 3.5 and 4 – but even then it’d be useful to use in your own code for that.