Вот как я устанавливаю свою страницу в соответствии с моей колонкой базы данных:
Это код (только для первого столбца)
<table class="table">
<tr>
<th style="font-size: 20px">
@Html.DisplayNameFor(model => model.fileName)
</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<td style="font-size: 15px">
@Html.DisplayFor(modelItem => item.fileName)
</td>
<td>
@Html.ActionLink("File Details", "Details", new { id = item.id })
</td>
</tr>
}
</table>
Как я могу изменить fileName
на другую строку, когда на моей странице html?
Я не знаю, будет ли это работать (я не могу проверить его сейчас, а не на окнах),
[Display(Name = "File Name")] //this is the line you must add.
public string fileName{get;set;} //this is your model property name.
Это должно изменить его на File Name