Am I missing something here, why is the string template choosen here?
In both cases it's the String template being chosen. There's no default template for the double type. Here's how the default string template looks like:
@Html.TextBox(
"",
ViewData.TemplateInfo.FormattedModelValue,
new { @class = "text-box single-line" }
)
I've determined I can put a double template in the views shared folder and it will render that instead but it seems like I shouldn't have to do that.
Well, if you are not satisfied with the default template for the double type (which is string.cshtml
) you could always write a custom template for it.