예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string json    = correoBLL.BuscarAllCorreos();
        var    jCorreo = JsonConvert.DeserializeObject <dynamic>(json);

        var builder = new StringBuilder();

        builder.AppendLine("<table id='example2' class='table table-bordered table-striped table-hover'><thead><tr><th>ID</th><th>Destino</th><th>Asunto</th><th>Estado</th><th>Fecha Registro</th></tr></thead><tbody>");

        foreach (var row in jCorreo.List)
        {
            builder.AppendLine("<tr><td>" + row.IdCorreo + "</td><td>" + row.Destino + "</td><td>" + row.Sujeto + "</td><td>" + row.EstadoCorreo + "</td><td>" + row.FechaRegistro + "</tr>");
        }

        builder.AppendLine("</tbody><tfoot><tr><th>ID</th><th>Destino</th><th>Asunto</th><th>Estado</th><th>Fecha Registro</th></tr></tfoot></table>");

        contenido.InnerHtml = builder.ToString();
    }