asp.net mvc user control problem foreach loop

Posted by mazhar on Stack Overflow See other posts from Stack Overflow or by mazhar
Published on 2010-05-10T20:37:32Z Indexed on 2010/05/10 20:44 UTC
Read the original article Hit count: 273

Filed under:
|

Previous post

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<% MvcApplication1.Models.FeaturesRepository _model = new MvcApplication1.Models.FeaturesRepository(); %>

<% foreach (var md in _model.GetAllFeatures()) { %> <%--<% if (md.int_ParentId == 0) { %>--%>

  • <%= md.vcr_FeaturesName %>
  • <%--<% } %>--%>

    <% } %>

    It is with reference to the previous post above.Is there something wrong with the foreach loop(The result is correct but it is displaying the series of Add,Add,Add,Add,Add,Add...,which is the last record of the getallfeatures.

    © Stack Overflow or respective owner

    Related posts about asp.net-mvc

    Related posts about ASP.NET