Repeater or listview vs concatenated html

After spending a small amount of time converting a page using concatenated html like

string output = "";
output +="<ul>";
foreach(MyClass item in MyItems)
{
  output += "<li>"+item.Name+" - "+item.SomeProperty.ToString()+"</li>";
}
output+="</ul>";

literalPlaceHolder.Text=output;

to use the ListView control, I just discovered that the original developer came back and converted the page back to a concatenated html. My personal opinion is that lists and repeaters provide cleaner, more informative markup that can be edited by someone with less experience with C #, and that they are faster and use less memory. At the very least, the page should use StringBuilder instead of string. Anyone have a good argument for this? I have a feeling that this will cause a serious conflict when I bring it.

+3
2

, , , , . , .

, ASP.Net , .

, StringBuilder, . , StringBuilder .

, , , , . ListView - , , .

, , . . , , , -. , , - ( , ). , .

+3

.

. . , , html, aspx ( ascx) .

, , Repeater, html- , , , , , , .

, Html. , , .

. - . . . , , . , . , , .

+4

Source: https://habr.com/ru/post/1724411/


All Articles