title: How would I change a property of an image without knowing its ID?
body: <p>I want to use the Sector variable that is sent to the SetSectorImage sub to name the image that is being changed (the images do already exist on the web form, I am only changing the URLs). A Google search only led me to an article on MSDN about the CallByName method but I don't know if it will work in this situation and of it will, I can't figure out how.</p>
  
  <p>Here's the article if it helps: <a href="http://msdn.microsoft.com/en-us/library/22x2chfx.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/22x2chfx.aspx</a></p>
  
  <pre><code>Imports System
  Imports System.IO
  
  Public Class Launcher
      Inherits System.Web.UI.Page
  
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
          SetSectorImage("Sector1")
          SetSectorImage("Sector2")
          SetSectorImage("Sector3")
      End Sub
  
      Sub SetSectorImage(Sector As String)
          Dim SectorStatus As String
          Try
              Using Reader As New StreamReader(Sector + ".txt")
                  SectorStatus = Reader.ReadToEnd()
                  Reader.Close()
                  Sector_SHOULD_BE_USED_HERE.ImageUrl = ("~/Images/" + SectorStatus)
              End Using
          Catch ex As Exception
              ErrorMessage.Text = ("There was an error reading the status of: " + Sector)
              ErrorMessage.Visible = True
          End Try
      End Sub
  
  End Class
  </code></pre>