繁体   English   中英

当我通过HTML显示时,从数据库列更改字符串

[英]Change the string from database column while I displays over html

这是我根据数据库列设置页面的方式:

在此处输入图片说明

这是代码(仅适用于第一列)

<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>

在html页面上,如何将fileName更改为另一个字符串?

我不知道这是否行得通(目前无法在Windows上进行测试),

[Display(Name = "File Name")]    //this is the line you must add.
public string fileName{get;set;} //this is your model property name.

这应该将其更改为File Name

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM