public async Task<IActionResult> EducationalI(EducationalImageViewModel obj_Parameter, IFormFile EducationImage)-But I have a issue here Null Value.
i have use this upload file use this html code.
- @using (Html.BeginForm("EducationalI", "EducationalManagement", FormMethod.Post, new { id = "CreateForm", enctype = "multipart/form-data" }))
- {
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title has-icon ms-icon-round "> Add New Image</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- </div>
- <div class="modal-body dnnn">
- <form method="post">
- <div class="ms-form-group">
- <label for="img">Select image: </label>
- @Html.TextBoxFor(x => x.Image, new { @type = "file", @id = "image", @name = "EducationImage", @accept = "image/*", @required = "required" })
- </div>
- @Html.ValidationMessageFor(x => x.Image, "", new { @class = "text-danger" })
- <div class="ms-form-group has-icon">
- <label for="choosecategory">Image Title</label>
- @Html.TextBoxFor(x => x.Title, new { @type = "text", @id = "ImageName", @class = "form-control", @placeholder = "Enter Title", @required = "required" })
- @*<input type="text" class="form-control" placeholder="Enter your Category">*@
- </div>
- @Html.ValidationMessageFor(x => x.Title, "", new { @class = "text-danger", @style = "color:red;!important" })
- <div class="ms-form-group has-icon">
- <label for="choosecategory">Image Description</label>
- @Html.TextBoxFor(x => x.Description, new { @type = "text", @id = "ImageDescription", @class = "form-control", @placeholder = "Enter Description", @required = "required" })
- @*<input type="text" class="form-control" placeholder="Enter your Category">*@
- </div>
- @Html.ValidationMessageFor(x => x.Description, "", new { @class = "text-danger", @style = "color:red;!important" })
- </form>
- </div>