I think I need Anger Management therapy after losing waaaaay to much time looking at a problem inside ASP.NET MVC.
What was the problem?
I created a nice ASP.NET MVC EditorTemplate to use the Kendo UI NumericTextBox for decimal fields. Here is the corresponding Razor file:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model decimal? | |
@Html.TextBoxFor(model => model, new { @class="numericTextBox" , type="number" , min="0", max="1000000000000", step="1"}) |
But for an unknown reason MVC wasn’t picking up the correct EditorTemplate. Here is the original code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Html.EditorFor(model => model.Limit, new { htmlAttributes = new { @class = "form-control" } }) |
I had to update the code to include the EditorTemplate type to get it working:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Html.EditorFor(model => model.Limit, new { htmlAttributes = new { @class = "form-control decimal" } }) |
Smells like a bug to me!