I’m working with a table of asp.net controls on client side. They are all named in the following fashion when they are created on server side: “txt_name_” + rowNum. I know I can access them by their id by using “<%=Control.ClientID%>”. On client side I have access to current row num via a javascript variable. I’m wondering how I can access one of the controls on client side by using something like the following(which doesn’t seem to work): “<%=txt_name_” + jsRowNumVar + “.ClientID%>”. so I’m essentially trying to substitute a javascript variable as part of an asp.net control name and it doesn’t seem to be working. Any ideas on how I would accomplish this?
Share
As an alternative, you can render your rows’ client ids with an javascript array, and you can use it with the row index.
Then use the control id array in your client scripts :