Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 1
    what is error and,in model i think you have collection of same item and all items will contain same attribute name for same value. Commented Aug 9, 2015 at 13:24
  • Yes, you're right. I was actually looking for a way to display values, but apparently MVC6 does not have tag helper for this yet. The error is that there is no "item" in scope, which makes sense because Model.item does not exist. Commented Aug 9, 2015 at 13:36
  • @ConvertToInt32 - actually even if I put <label> outside for foreach, I still don't get what should be in asp-for. My model is IEnumerable<>. Commented Aug 9, 2015 at 13:38
  • 1
    Instead of using IEnumerable<T> as your model try IList<T>. Commented Aug 11, 2015 at 7:11
  • 1
    You said your model is IEnumerable<>. Switch it to IList<> like adding '.ToList<>()' at the end, in code behind. Commented Sep 4, 2015 at 20:49