In my ASP.NET application, I have a table where I dynamically add rows. Each row contains cells with textboxes that are generated dynamically. Here is an example of how I do it:
tc = new TableCell();
TextBox t_total = new TextBox();
t_total.ID = "txtTotal" + dt.Rows[i]["Id"].ToString();
tc.Controls.Add(t_total);
tr.Cells.Add(tc);
After setting an ID for the textbox, I want to be able to change this ID in a JavaScript function. For instance, if the initial textbox ID is "txtTotal1000", I would like to change it to "txtTotal2000" in my JavaScript function so that I can access it using the new ID. How can I achieve this?