我的查看数据
中有一个文档名称和ID列表ViewData["Documents"] = new SelectList(repo.GetDocumentForMeeting(id), "DocId", "FileName");
我需要在View Data中显示与docID和文件名的数量一样多的操作链接。 我不想使用Html下拉列表来选择值。有一个简单的方法吗?
<%= Html.ActionLink(
ViewData-Doc Name,
"GetDocumentPage",
"Document",
new { id = ViewData-DocId },
new { id = "displayDoc" }
) %>
答案 0 :(得分:0)
即使我遇到类似的问题,看起来没有直接解决在Html帮助方法的参数部分中读取ViewData的问题。对我来说,这部分代码无效:
new { id = ViewData-DocId }
我问的是以下问题:
Passing data to controller while Using URL.Action in jQuery template in Asp.Net MVC dynamic views