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.

Timeline for MVC 6 Tag Helpers and foreach

Current License: CC BY-SA 3.0

5 events
when toggle format what by license comment
Jul 6, 2016 at 19:06 comment added nam Tag helper for <label> will not be that important here. But if you wan to use it, as @JoelCunningham stated, use <label asp-for="@item.BookingCode">@item.BookingCode</label> asp-for value will display the heading as a property name and @item.BookingCode inside <label ...>...</label> will display the value of @item.BookingCode.
Jun 4, 2016 at 8:57 comment added Joel Cunningham Since this is for a label element the asp-for defaults to the property name and not the value of BookingCode. Use @item.BookingCode with no element to see the value.
Apr 27, 2016 at 20:12 comment added Ross In 1.0.0-rc1-update1 the above code simply prints "BookingCode" text instead of the actual value of the BookingCode property. Any other solutions?
Aug 9, 2015 at 18:54 vote accept Sergey Kandaurov
Aug 9, 2015 at 18:14 history answered N. Taylor Mullen CC BY-SA 3.0