C# ¿;如何在asp.net mvc中声明十进制类型的EditorFor?

C# ¿;如何在asp.net mvc中声明十进制类型的EditorFor?,c#,asp.net,C#,Asp.net,视图中的我的代码 @Html.EditorFor(model = model.Debe, new{htmlAtributes = new{@class="form-control bor"}}) 我看到的错误 System.InvalidOperation.Exception:'The model item passed into the dictionary is null, but this dictionary requires a non-null model item of type

视图中的我的代码

@Html.EditorFor(model = model.Debe, new{htmlAtributes = new{@class="form-control bor"}})
我看到的错误

System.InvalidOperation.Exception:'The model item passed into the dictionary is null, but this dictionary requires a non-null model item of type'System.Decimal'.'
视图模型

[Required]
public decimal Debe {get; set;}

这不是
编辑器for
的问题。你的控制器有问题。你从你的行动中得到了什么?你错过了一个“>”。应该是model=>model.Debe