上传文件示例
This commit is contained in:
parent
68966ed7d7
commit
76999b805d
|
@ -4,7 +4,7 @@
|
|||
}
|
||||
|
||||
|
||||
@using (Html.BeginForm())
|
||||
@using (Html.BeginForm("ImageUpload", "HomeController", FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
|||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.imageFile, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@Html.EditorFor(model => model.imageFile, new { htmlAttributes = new { @class = "form-control" } })
|
||||
<input type="file" name="imageFile" id="imageFile" />
|
||||
@Html.ValidationMessageFor(model => model.imageFile, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user