Ben

Ben

  • NA
  • 1
  • 0

Access a typed object using ID string

Jul 1 2010 6:46 PM





Hi, how can one access a typed object's properties using a programmatically created ID string?

'There are 10 image buttons on the page with ID imagebutton1, imagebutton2,...

Dim imgBtn as Imagebutton 
Dim imgIDString as String

For i as Integer = 1 to 10
    imgIDString = "ImageButton" & i.ToString 

    'Do what here to make imgBtn an instance of object with ID imgIDString?

    imgBtn.property = array(i-1)
Next
 
Or is there a better way to do this task?