当更新图像文本框图像名称不出现时

时间:2018-07-13 19:56:35

标签: javascript html asp.net-mvc razor

使用剃须刀语法的.net MVC 5中的

我正在尝试更新文件,但是单击更新后,文件名未显示在文本框中,有关更清晰的图片,请参阅该图片, enter image description here

cshtml代码为

 <div class="form-group">
                                @Html.ReqLabelFor(model => model.file_path, htmlAttributes: new { @class = "control-label col-md-2" })
                                <div class="col-md-5 offset-md-5">
                                    @*@Html.TextBox("upload", null, new { type = "file", accept = "image/*", @class = "form-control" })*@
                                    @Html.TextBox("file", null, new { type = "file", @class = "form-control" })
                                    @Html.ValidationMessageFor(model => model.file_path, "", new { @class = "text-danger" })
                                </div>
                            </div>

c#代码为

File fileDownload = await db.File.Where(x => x.id == id).FirstOrDefaultAsync();
  

其中file_path是字符串类型。

但是实际上它应该像下面的图片一样 enter image description here

0 个答案:

没有答案