views:

29

answers:

1

I am trying to create divs dynamically in a view page of an asp.net mvc project. This is the pseudo code:

<%
        foreach (element in Model)
        {
           create the html div element with Div.id = Model.id 
        }
    %>

I looked in the system.web.mvc.htmlhelper object. It provides support for a lot of html elements but not a div. Any Hints ?

+1  A: 

There is no such helper for div. But, you can create your own HTML helper for it.

or simply you can go ahead and create divs in view page as

<%
        foreach (element in Model)
        {
           %>
          <div id="<%:element.id%>">
                .. some html..
           </div>     
      <%}
    %>
ajay_whiz