如何在asp.net MVC中检索@ html.editorfor的值?

时间:2019-02-18 01:46:09

标签: c# asp.net asp.net-mvc

我需要检索startdate的值,以便可以将startdate与开始时间结合起来并获取日期时间。如何检索@html.EditorFor的数据或值?

我已经尝试使用jQuery来获取数据,但是我找不到将jQuery和@{}内的值链接起来的方法。

@Html.EditorFor(model => model.StartDate, new { htmlAttributes = new { 
@class = "form-control border-input", @type = "date", id = "modelId" } 
})
@Html.ValidationMessageFor(model => model.StartDate, "", new { @class = 
"text-danger" })
@Html.EditorFor(model => model.StartTime, new { htmlAttributes = new { 
@class = "form-control border-input", @type = "time", id = "modelId2" } })
@Html.ValidationMessageFor(model => model.StartTime, "", new { @class = 
"text-danger" })

我希望我可以将日期和时间结合在一起

0 个答案:

没有答案