HI Rick.
Do you know if it is working using Windows forms too?
I actually found a workaround that uses the Controls collection but I need to loop through the collection!
>Eric,
>
>Youc an use Reflection...
>
>
>Label x = (Label)
>WebForm.GetType().GetProperty("Label" + Convert.ToString(i)).GetValue(WebForm,null);
>
>MessageBox.Show(x.Text);
>
>
>Actually, you'll likely have to use GetField() instead of GetProperty()... Also, I'm not sure, but I think you need to make sure that the scope is at least Protected not private or Reflection won't be able to find it...
>
>+++ Rick ---
>
>
>>I want to cast
>>
>>"label" + Convert.ToString(i)
>>
>>into a System.Windows.Forms.Label so that I can use
>>
>>MessageBox.Show(x.Text);
>>
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com