Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indirect reference to controls or binding to arraylist i
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01341965
Message ID:
01342159
Views:
19
This is simplified so it's easier to see, but try something like this instead:
for (int i = 1; i < 4; i++)
{
    string txtName = "textBox" + i.ToString();
    TextBox control = (TextBox)this.GetType().GetField(txtName, MemberAccess).GetValue(this);
                
    control.Text = i.ToString();
}
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform