简体   繁体   English

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

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

This is how i am set my page according my database column: 这是我根据数据库列设置页面的方式:

在此处输入图片说明

This is the code (only for the first column) 这是代码(仅适用于第一列)

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

How can i change fileName to another string when over my html page ? 在html页面上,如何将fileName更改为另一个字符串?

I don't know if this will work(I am unable to test it at the moment, not on windows), 我不知道这是否行得通(目前无法在Windows上进行测试),

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

This should change it to File Name 这应该将其更改为File Name

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

相关问题 数据库中的HTML显示为纯文本 - HTML from database displays as plain text 从数据库编辑列时不要更改datagridview - Do not change the datagridview while editing a column from the database 从数据库中选择时可以设置列的显示名称吗? - Can I set display name for column while selecting from Database? 从数据库中检索时我需要更改日期格式 - I need to change the format of date while retrieving from database 我必须将多个图像存储在一个字符串变量中,以便可以将该变量移交给表对象以将其保存到单个数据库列中 - I have to store multiple images in a string variable so that i can hand that variable over to table object to save it into single database column 如何在整个文件中使用循环从文件中提取字符串文本? - How can i extract a string text from a file using loop while all over the file? 在用数据库中的数据填充comboBox的同时,我创建了SqlDataReader。 我希望检索包含产品名称的列 - While filling comboBox with data from database, i created SqlDataReader. I wish to retrieve a column with product names 使用字符串从数据库获取列 - get column from database using a string 从数据库检索html内容并解析为字符串 - retrieve html content from database and parse to string 如何获取gridview的html列以从数据库中预填充表单? - How can I get html column of gridview to prepopulate form from database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM