【发布时间】:2018-03-11 13:03:39
【问题描述】:
如何在 Razorview 中为用户输入添加税值
这是当前代码
<div class="form-group">
@Html.LabelFor(model => model.Price, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@{
double tax = 12.5;
}
@Html.EditorFor(model => model.Price * tax, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Price, "", new { @class = "text-danger" })
</div>
</div>
这不起作用,请帮助我
【问题讨论】:
-
实际上,当我运行此代码时,应用程序崩溃了 - 所以如果我在代码中输入错误,我需要帮助。