this is my code
Expand|Select|Wrap|Line Numbers
- protected void Page_Load(object sender, EventArgs e)
- {
- for (int i = 0; i < 10; i++)
- {
- TableRow tr = new TableRow();
- TableCell td1 = new TableCell();
- Label lab1 = new Label();
- lab1.ID = "count" + i;
- lab1.Text = i.ToString();
- td1.Controls.Add(lab1);
- TableCell td2 = new TableCell();
- Button but1 = new Button();
- but1.Text = "increase";
- but1.Click +=new EventHandler(increasebuttonclick(i));
- td1.Controls.Add(but1);
- TableCell td3 = new TableCell();
- Button but2 = new Button();
- but2.Text = "Decrease";
- but2.Click += new EventHandler(decreasebuttonclick(i));
- td3.Controls.Add(but2);
- tr.Cells.Add(td1);
- tr.Cells.Add(td2);
- tr.Cells.Add(td3);
- Table1.Rows.Add(tr);
- }
- }
- private object decreasebuttonclick(int i)
- {
- //throw new Exception("The method or operation is not implemented.");
- "count" + i.Text = Convert.ToString("count" + i.Text - 1);
- }
- private object increasebuttonclick(int i)
- {
- //throw new Exception("The method or operation is not implemented.");
- "count" + i.Text = Convert.ToString("count" + i.Text + 1);
- }
here i want
1. button click event with my parameter (ex. increase buttonclick(string i)
2. i want increase my label box value
Pls guide me