我有一个问题,我在操作方法中设置的值如下,并且隐藏的值在视图中可用。现在,当我将表单发布到操作方法时,隐藏字段值消失了。对此有什么想法吗?
@using (Html.BeginForm("Create", "RunLogEntry", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@Html.HiddenFor(model => Model.OutputStoredFileName)
<button name="submit" class="art-button" type="submit" value="Populate" style="width: 100px">
Attach</button>
}
[HttpPost]
public ActionResult Create(RunLogEntry runLogEntry, String ServiceRequest, string Hour, string Minute, string AMPM,string submit, IEnumerable<HttpPostedFileBase> file, String AssayPerformanceIssues1)
{
if(submit == "Populate")
{
//Runlogentry is the model
if ((System.IO.File.Exists(runLogEntry.OutputStoredFileName)))
System.IO.File.Delete(runLogEntry.LoadListStoredFileName);