1
我用下面的代码在我看来,并使其被赋予错误(IEnumerable<ITClassifieds.Models.Resume>
)元素的IEnumerable < >不支持
<%--
foreach (ITClassifieds.Models.Resume c in (IEnumerable<ITClassifieds.Models.Resume>)ViewData["getresume"])
{ %>
<input type="radio" name="resumeID" value="<%=c.ResumeID %>" checked="checked"/>Yes
<input type="radio" name="resumeID" value="0"/>No
<%} %>
你确定这是一个枚举集的'ITClassifieds.Models.Resume'您通过努力循环? – BoltClock 2011-05-25 08:37:32
@BoltClock,好点。当使用'ViewData'时,这总是问题。没有智能感知,你永远不知道正确的类型,你应该在视图中执行丑陋的表演,并且由于这些错误在运行时更难以找到并显示。这些是我总是避免使用'ViewData'来支持强类型视图和视图模型的原因之一。 – 2011-05-25 08:50:05
那么这是什么解决方案?我如何识别错误? – iProgrammer 2011-05-25 09:28:32