unordered lists
tagbuilder を使用して2 つを作成しようとしています。
public static MvcHtmlString GenerateMultipleUL<T>(this HtmlHelper html, IGridable<T> model)
where T : class
{
int itemsCount = model.RowModels.Count();
TagBuilder ulTag = new TagBuilder("ul");
foreach(var indexedItem in model.RowModels.Select((p, i)=> new {item = p, Index = i}))
{
if (itemsCount / 2 == indexedItem.Index)
{ //create a new Un ordered List
ulTag = new TagBuilder("ul"); // This resets the old values with new ones but i want to close the old UL and create a new one.
}
TagBuilder liTag = new TagBuilder("li");
..........
ulTag.InnerHtml += liTag;
}
return new MvcHtmlString(ulTag.ToString());
}