我正在将日期和图像添加到数据库中。我希望将日期作为上传的图像的页脚添加。
图像上传的HTML代码:
图像上传的HTML代码:
upload
<div class="form-group">
@Html.Label("Photo", htmlAttributes: new { @class = "control-label" })
<div class="col-md-10">
<img id="DocImg" src="~/Upload/DoctorImage/doc-default.png" style="cursor: pointer;" accesskeyclass="edtImg" width="100" height="100" />
<input type="file" id="fileUpload" name="Photo" accept="image/*" />
</div>
</div>
日期选择器
的HTML代码
<div class="col-6">
@Html.ValidationSummary(true, "", new { @class = "text-danger"})
<div class="form-group">
@Html.Label("Joining Date", htmlAttributes: new { @class = "control-label col-md-2", @required = "required" })
<div class="col-md-10">
@(Html.Kendo().DatePicker()
.Name("JoiningDate")
.Value("")
.HtmlAttributes(new { style = "width: 100%", required = "true" })
)
@Html.ValidationMessageFor(model => model.JoiningDate, "", new { @class = "text-danger" })
</div>
</div>
</div>
上传脚本
$(document).ready(function () {
$("#fileUpload").hide();
});
$("#DocImg").click(function () {
$("#fileUpload").trigger('click');
});