I can not perform enumeration, I have already switched to another information reception in the View but I do not know how to correct it, I checked other forms in StackOverflow but I did not understand.
Model:
namespace WebApplication4.Models
{
public class modelExemplo
{
public StringBuilder lista { get; set; } = new StringBuilder();
}
}
Controller:
namespace WebApplication4.Controllers{
public ActionResult funcaodeteste()
{
modelExemplo obj = new modelExemplo();
obj.listNewsletter.AppendLine("teste1");
obj.listNewsletter.AppendLine("teste2");
return View(obj);
}
}
View:
@model IEnumerable<WebApplication4.Models.modelExemplo>
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Download</title>
</head>
<body>
@foreach (var item in Model) {
<p>item</p>
}
</body>
</html>