【问题标题】:MVC Editor Template for Decimal and Integer十进制和整数的 MVC 编辑器模板
【发布时间】:2012-11-21 03:58:06
【问题描述】:

我尝试为 Decimal 和 Integer 类型创建一个简单的自定义编辑器模板:

@ModelType Decimal?
@Html.NumericBoxFor(Function(m) m)

@ModelType Integer?
@Html.NumericBoxFor(Function(m) m)

将它们保存为 ~/Views/Shared/EditorTemplates/Decimal.vbhtml 和 ~/Views/Shared/EditorTemplates/Integer.vbhtml(也尝试过 Int32.vbhtml)。

但是我的自定义 HtmlHelper 函数永远不会被调用。在网上搜索并尝试了很多东西后无法弄清楚..这里有什么问题?

【问题讨论】:

  • 我刚刚发现应用程序中有一个自定义 ViewEngine,它搞砸了路径(通过 global.asax 定义)。删除它可以解决问题。
  • 你能发表你的评论作为答案吗?

标签: asp.net-mvc vb.net razor asp.net-mvc-4


【解决方案1】:

我刚刚发现应用程序中有一个自定义 ViewEngine,它搞砸了路径(通过 global.asax 定义)。删除它可以解决问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多