c# - HTML.TextBoxFor 正在预填充模型名称
问题描述
我有一个 HTML.TextBoxFor 预填充 System.Collections.Generic.List`1[System.String]
我试过添加一个空属性和空“”,但这只会引发错误。我怎样才能让它加载并清空文本框。
@foreach (var item in pendingReg.PaymentOptions.RegistrationPaymentTypes)
{
@Html.RadioButtonFor(m => Model.PendingRegistrations.Cart[i].PaymentOptions.PaymentTypes, item.RegistrationTypePaymentTypeID, new { data_val = item.PaymentTypeID })
<span>@item.PaymentName</span>
<br />
if (item.PaymentTypeID == 4)
{
@Html.TextBoxFor(model => Model.PendingRegistrations.Cart[i].PaymentOptions.PurchaseOrders, null, new { @class = "textboxClass", @value=""})
}
}
解决方案
推荐阅读
- javascript - 如何更改倒计时的显示?
- javascript - 如何在 Slick Slider 的第一张幻灯片中制作一行,在所有其他幻灯片中制作两行?
- javascript - Yargs 中的命令函数
- python-3.3 - python 3从字符串中删除所有新行标记
- php - Yii2 将表从一个数据库复制到另一个数据库
- selenium - 无法启动浏览器
- python - 如何访问熊猫系列中的项目?
- wordpress - 为什么表单提交后elementor中的弹出窗口关闭?
- c++ - 如何使用 C++ 程序在 Linux 中重新加载 .bash_profile?
- typescript - 什么时候不能使用 `[key in SOME_UNION_TYPE]` 作为接口的顶级属性?