Saludos a todos,
Supongo que ya han puesto comentarios sobre este caso.....
Pero buscando la verdad no me ha salido el ejemplo y no se que me falla.
Quiero hacer una tabla dinamica, mediante ajax.
1 table dentro de 1 updatepanel que agregue los datos de 1 textbox al presionar 1 boton.
http://img329.imageshack.us/img329/528/ejemplowo4.jpg
Código:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
private int CONTADOR;
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsAsync || !Page.IsCallback || !Page.IsPostBack)
initContador();
TableCell cell;
TableRow row;
for(int i =0;i<10;i++)
{
row = new TableRow();
for(int j =0;j<10;j++)
{
cell = new TableCell();
cell.Text = " Cell "+i+" "+j;
row.Cells.Add(cell);
}
TablaEstatica.Rows.Add(row);
}
}
public void initContador() { CONTADOR = 0; }
public void addContador() { CONTADOR++; }
protected void btAdd_Click(object sender, EventArgs e)
{
TableCell cell;
TableRow row;
row = new TableRow();
cell = new TableCell();
cell.Text = tbDatos.Text;
row.Cells.Add(cell);
cell = new TableCell();
cell.Text = CONTADOR.ToString();
addContador();
row.Cells.Add(cell);
TablaDinamica.Rows.Add(row);
}
}