将模型作为参数传递给FileStreamResult

时间:2016-08-05 16:56:27

标签: asp.net asp.net-mvc-4 filestreamresult

我想将模型作为参数传递给我的控制器中的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>

0 个答案:

没有答案