0

Please help me how can I write Bootstrap css class for @TextboxFor when its under @foreach loop

foreach (MasterTable item in Model._ListMasterTable)
{
     @Html.TextBoxFor(x => x._ListMasterTable, new { Value = item.Master_Name });
}

Thank you

Rahul Nikate
  • 6,192
  • 5
  • 42
  • 54
  • Possible [duplicate](https://stackoverflow.com/questions/23353824/asp-net-mvc-razor-bootstrap-input-form) – Michael Sep 23 '19 at 06:16
  • Possible duplicate of [Asp.Net MVC Razor BootStrap Input Form](https://stackoverflow.com/questions/23353824/asp-net-mvc-razor-bootstrap-input-form) – Rahul Nikate Sep 23 '19 at 06:19

1 Answers1

2

This should do

foreach (MasterTable item in Model._ListMasterTable)
{
     @Html.TextBoxFor(x => x._ListMasterTable, new { Value = item.Master_Name, @class = "YOUR BOOTSTRAP CLASS HERE"});
}
Rahul Nikate
  • 6,192
  • 5
  • 42
  • 54
Michael
  • 395
  • 1
  • 13