0

我想将模型作为参数传递给控制器​​中的 FileStreamResult,但我得到了 null。这是我想在 m 中获取模型的控制器文件

[HttpPost]
            public FileStreamResult GETPdf(MarkModel m)// here i want value from my view 
            {
                var MarkRe = new List<Mark>();
                var mark = new List<MarkModel>();
                using (StudentInfoSystemEntities db = new StudentInfoSystemEntities())
                {
                    mark = (from e in db.Marks
                            from s in db.Students
                            where e.StudentId == s.ID
                            && e.StudentId == m.StudentId
                            select new MarkModel

这是我想向控制器发送值的视图

<div class="editor-field">
                @Html.DropDownListFor(m => m.StudentId, @ViewBag.Students as List<SelectListItem>)
                @Html.ValidationMessageFor(m => m.StudentId)
            </div>
            <div>
                Export Data : @Html.ActionLink("Export to PDF", "GETPdf", "GetMarkRec")
            </div>
4

0 回答 0