I have pretty basic question in #C. I have some text boxes named TextBox1,TextBox2,….,TextBox10 on web form and I want them to access in loop , something like
For(var count=1;count<10;count++) {
TextBox+count.tostring().text="something"
}
Can we do eval() like JavaScript?
If you plan to do this on the server side then you could use Page.Controls (or some other container where your textbox objects are located). For example:
but if you can do this on the client side it would be even better and more interactive than sending data back to server and processing it over there.
Javascript solution using jQuery might look something like this: