开发者

element IEnumerable< > is not supported

i have used the following code in my view and made the model it is giving the error in (IEnumerable<ITClassifieds.Models.Resume>)

<%--  
    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"/>开发者_StackOverflow;No
  <%} %>


  1. Go back to where you are setting getresume in your controller.. confirm that it is setting to what you are expecting.

  2. Post the full error you are receiving.

Or

  1. Create yourself a viewmodel and use that instead. Dynamics are great and I use them a fair amount but when it comes to views I always go with strongly typed.

http://geekswithblogs.net/michelotti/archive/2009/10/25/asp.net-mvc-view-model-patterns.aspx - Talks about a few different ways to do your viewmodels.

Another interesting link would be -> ViewModel Best Practices

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜