Reputation: 903
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 ?
Upvotes: 0
Views: 910
Reputation: 17931
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>
<%}
%>
Upvotes: 1