0
I’m developing a code on. NET Core Razor Pages, and in part, I would like to create a list of items according to data that I am already picking up there...
My Code: (Arquivo.Cs)
var descr = "<ul>";
for (int i = 1; i < 9; i++)
{
descr += "<li>" + result.vfp.descricao[i].desc + "</li>";
}
descr += "</ul>";
HttpContext.Session.SetString("xmltojson", descr);
(cshtml file):
<div class="card menu-card">
<div class="card-body">
<center><h4> @HttpContext.Session.GetString("xmltojson")</h4></center>
</div>
</div>
RESULT:
He’s writing the tags, instead of putting them together, someone can help me?
@Html.Raw(HttpContext.Session.GetString("xmltojson"))
wouldn’t be like this?– SylvioT