Is there any way in which you can access the properties of an html element by breaking up the id into a string in ASP.NET? By this I am referring to the way in which you can do this with JavaScript to cycle through a numbered set of IDs like an array.
For example I can treat Div1 to Div10 like an array by going:
document.getElementByID("Div" + i).innerhtml
I cannot seem to find any information on this or a way of asking it in a google search.
If this type of thing is not possible then I would be interested to hear some examples of how else this could be done. I am surprised I cannot find an answer because I am sure many people use the type of method I mentioned in JavaScript.
UPDATE: Please give me a while to give an example of code. I thought this was self explanatory but seemingly it is not... This is VB by the way.
Someone put javascript as a tag!! This is asp.net VB.
Is this basic example enough?
sub exampleProcedure()
For i = 1 to 10
document.getelementbyid("Div" & i).innerHTML = "A String"
if i = 5 then
document.getelementbyid("Div" & i).innerHTML = "This is Div5"
end if
next
end sub
Oh and it might be worth mentioning that that would work in VbScript (which I have been unfortunate enough to have had to work with at university!)