Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically obtaining a reference to Buttons (C#)
Message
From
27/05/2004 13:39:18
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Programmatically obtaining a reference to Buttons (C#)
Miscellaneous
Thread ID:
00907871
Message ID:
00907871
Views:
40
Hi,

I have 3 Buttons on a web form, btn1, btn2 and btn3. I would like to loop thru a for-loop and set the Text property for each, namely 1, 2 and 3 respectively. Can someone please suggest a way to do it. I don't know how to get a reference to each button programmatically.
for (btncnt = 1; btnctn<=3; btncnt++)
{
  // get a reference to the button and call it oButton
  oButton.Text = btncnt.ToString()
}
Regards,
Neil
Next
Reply
Map
View

Click here to load this message in the networking platform