【问题标题】:How can I write Bootstrap css class for TextboxFor when it's under @foreach loop当 TextboxFor 在 @foreach 循环下时,如何为它编写 Bootstrap css 类
【发布时间】:2020-01-23 04:12:32
【问题描述】:
当@TextboxFor在@foreach循环下时,请帮助我如何为@TextboxFor编写Bootstrap css类
foreach (MasterTable item in Model._ListMasterTable)
{
@Html.TextBoxFor(x => x._ListMasterTable, new { Value = item.Master_Name });
}
谢谢
【问题讨论】:
标签:
c#
asp.net-mvc
twitter-bootstrap
razor
【解决方案1】:
应该这样做
foreach (MasterTable item in Model._ListMasterTable)
{
@Html.TextBoxFor(x => x._ListMasterTable, new { Value = item.Master_Name, @class = "YOUR BOOTSTRAP CLASS HERE"});
}