Overriding ViewData.TemplateInfo.HtmlFieldPrefixwith an empty string is unacceptable , is there a way so that the prefix does not penetrate the nested set of strongly typed calls for the editor or DisplayFor?
Here is the ugly markup / code I'm still working with:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.Web.Mvc.SelectList>" %>
<% ViewData.TemplateInfo.HtmlFieldPrefix = ""; %>
<%=Html.DropDownList("sort", Model)%>
I tried * For overload, which allows you to specify htmlFieldName, but this only changes the immediate level. If I have a prefix at the point of this call, I just change what is added to the prefix.
I could write the markup of the template manually, but to do this for the object SelectListit seems that I will just finish copying through the MVC source with one setting, since it is connected with the data binding logic of the object.
source
share