Attach event handeler btnUpld runtime.
Button btnUpld = new Button();
btnUpld.Width = 100;
btnUpld.ID = "btnUpRow" + i + "Col" + j;
btnUpld.Text = "Upload";
btnUpld.Click += new EventHandler(btnUpld_Click);
cell.Controls.Add(btnUpld);
//code behind
private void btnUpld_Click(object sender, System.EventArgs e)
{
// Add upload functionality here
}