【问题标题】: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"});
}

【讨论】:

    猜你喜欢
    • 2016-05-09
    • 2012-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-05
    相关资源
    最近更新 更多