1

EDIT

enter image description here

 Table table = new Table();
 TableRow tableRow = new TableRow();
 TableCell tableCell = new TableCell();

 tableCell.Text = "id";
 tableRow.Cells.Add(tableCell);

 tableCell = new TableCell();
 tableCell.Text = "name";                        
 tableRow.Cells.Add(tableCell);

 table.Rows.Add(tableRow);

//-----------

 tableRow = new TableRow();
 tableCell = new TableCell();
 tableCell.Text = "1";
 tableRow.Cells.Add(tableCell);

 tableCell = new TableCell();
 tableCell.Text = "a";                        
 tableRow.Cells.Add(tableCell);

 table.Rows.Add(tableRow);
 tableRow = new TableRow();


 tableRow = new TableRow();
 tableCell = new TableCell();
 tableCell.Text = "2";
 tableRow.Cells.Add(tableCell);

 tableCell = new TableCell();
 tableCell.Text = "b";                        
 tableRow.Cells.Add(tableCell);

 table.Rows.Add(tableRow);
 tableRow = new TableRow();

How can add client function to the first row?

I want when the user clicks on the first row (name or id) slideToggle other row.

This table is created at run time.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user1263390
  • 187
  • 3
  • 4
  • 12

1 Answers1

0

you give this row an id for example id="row1",

I am not sure how to give the table and the row an id in ASP,

$("#row1").live("click", function(){
    $(this).slideToggle();
});
mfadel
  • 887
  • 12
  • 32